James 2:21  Was not Abraham our father justified by works,…. Not as the causes of his justification, that is denied, Rom_4:2 but as effects of it, showing the truth of his faith, and the reality of his justification: he had both faith and works, and the former were known by the latter; and even the faith which he had expressed years ago was manifested, demonstrated, and confirmed to be true and genuine, by the instance of his obedience to God, here produced; by which it appeared he was a true believer, a justified person, approved of God, and loved by him. Now if this was the case of Abraham, the father of the Jewish nation, yea, the father of the faithful, of all that believe, he is, and must be a vain man, that talks of faith without works; and his faith must be a dead one, and he be very unlike the father of them that believe: the good work instanced in is the offering up of Isaac;

when he had offered Isaac his son upon the altar: for when he was bid to take his son, his only and beloved son, Isaac, and offer him up on one of the mountains, that should be shown him, he made haste to do it; he provided everything for it; he split the wood, and carried it with him, and fire in his hand; he built an altar, laid the wood on it, bound his son, laid the wood on the altar, and his son on the wood, and stretched out his hand, with his knife in it, to slay him; so that it was all one, with respect to his intention and will, as if he had actually offered him, and was a full trial and proof of his obedience to God.

This was not the only act of obedience, or good work, which he performed; but this being a very eminent one, the apostle instances in it, as a very considerable evidence of his faith in God, and love to him; and which showed him to be a justified person, as he was long before he performed this action, even before Isaac was born; see Gen_15:6 and therefore it can never be the apostle's meaning, that he was justified before God by this, or any other good work or works, as cause or causes of it; but only that he was declared to be so; or, in other words, that his faith was attended with good works, and evidenced by them.

James 2:22  Seest thou how faith wrought with his works,…. Not to justify him before God; for neither faith nor works are ever said in Scripture to justify any man; but his faith being of the right kind, a faith which works by love, it put him upon doing this work, and many others; for this was done in faith, Heb_11:17 as all good works are, which are properly such; and where there is true faith, it will influence and engage a man to do good works, as it did Abraham.

And by works was faith made perfect? not with an absolute perfection; for though Abraham's faith was very great, yet there were things lacking in it, and he had his fits and times of unbelief; and had he lived till now, his faith, in this sense, would not have been perfect; and he would have had reason to have used the apostle's petition, Luk_17:5 much less would it have been made thus perfect by works; but the sense is, that hereby his faith was declared to be sincere, unfeigned, true, and genuine; just as love is said to be perfected, 1Jo_4:17.

James 2:23  And the Scripture was fulfilled,…. Gen_15:6 which speaks of Abraham's faith, and the imputation of to him for righteousness; for the above action of Abraham, in offering up his son, was a clear proof of the truth of his faith, there commended: by this it was made known what a strong faith he had in God, and what reason there was to believe that he was a justified person.

Abraham believed God, and it was imputed to him for righteousness; See Gill on Rom_4:3 which shows both that Abraham was justified before he wrought this work, and therefore that could not be the cause or matter of his justification, but only an effect and evidence of it; and that his justification was by faith, or that object which his faith regarded, and had to do with, was his justifying righteousness:

and he was called the friend of God, 2Ch_20:7 he was loved by God with an everlasting love, who showed acts of friendship to him; called him by his grace, and blessed him with spiritual blessings, and increased him with the increase of God; favoured him with near communion with him, honoured him with high characters, and distinguished him by peculiar marks of his favour, and reckoned his enemies and friends as his own; Gen_12:8 and Abraham, on the other hand, loved God, and showed himself friendly to him; trusted in him, and believed every word of his; readily complied with his will, and not only yielded a cheerful obedience to his commands, but enjoined his children after him to observe them: this was a name which Abraham was well known by among the eastern nations; hence he is called by the Mahometans, חליל אללה, “Khalil Allah”, the friend of God; and Mahomet says himself (c),

“God took Abraham for his friend.”

(c) Koran, Sura 4:125.

Reference

Gill’s exposition of the entire bible