Good works are the consequence of salvation and not the other way around (Ephesians 2:8-10).
If this were true, I believe that Jesus would have known about it, but the Scriptures clearly reveal that He did not!
As for Ephesians 2:8-10,
One of the first Bible passages that I memorized as a young Christian was Ephesians 2:8-9 in the King James Version,
8. For by grace are ye saved through faith; and that not of yourselves: it is the gift of God:
9. Not of works, lest any man should boast.
I heard and read this passage being quoted very many times and frequently quoted it myself when witnessing to non-Christians. I thought that I understood it just fine until I began studying the Apostle Paul, his missionary journeys, the messages that he preached, and his epistles.* Then I became more and more familiar with Paul and his goals and objectives as the Apostle to the Gentiles and the obstacles that he encountered and dealt with.
Circumcision was a very important part of the Old Testament covenant of Law that in the Jewish mind separated Jews from Gentiles. The earliest Christians were all Jews and Christianity was understood by them to be a sect of Judaism. Therefore it was very difficult for them to accept the idea that an uncircumcised Gentile could be a Christian no matter how much he believed in Jesus. Explaining this mystery to both the Jews and Gentiles was one of Paul’s major goals and objectives, and hence a major theme in his Epistles to the Romans, the Galatians, and the Ephesians.
When Paul wrote of “works” that he contrasted with grace and faith, he was always referring to the works of the Law, that is, the Old Testament covenant of Law as opposed to the New Testament covenant of grace:
Gal. 2:16. nevertheless knowing that a man is not justified by the works of the Law but through faith in Christ Jesus, even we have believed in Christ Jesus, so that we may be justified by faith in Christ and not by the works of the Law; since by the works of the Law no flesh will be justified.
Gal. 3:2. This is the only thing I want to find out from you: did you receive the Spirit by the works of the Law, or by hearing with faith?
3. Are you so foolish? Having begun by the Spirit, are you now being perfected by the flesh?
4. Did you suffer so many things in vain--if indeed it was in vain?
5. So then, does He who provides you with the Spirit and works miracles among you, do it by the works of the Law, or by hearing with faith?
Gal. 3:9. So then those who are of faith are blessed with Abraham, the believer.
10. For as many as are of the works of the Law are under a curse; for it is written, "CURSED IS EVERYONE WHO DOES NOT ABIDE BY ALL THINGS WRITTEN IN THE BOOK OF THE LAW, TO PERFORM THEM."
Rom. 2:4. Or despisest thou the riches of his goodness and forbearance and longsuffering, not knowing that the goodness of God leadeth thee to repentance?
5. but after thy hardness and impenitent heart treasurest up for thyself wrath in the day of wrath and revelation of the righteous judgment of God;
6. who will render to every man according to his works: (ASV)
Rom. 3:27. Where then is boasting? It is excluded. By what kind of law? Of works? No, but by a law of faith.
28. For we maintain that a man is justified by faith apart from works of the Law.
And compare the following:
Gal. 2:21. “I do not nullify the grace of God, for if righteousness
comes through the Law, then Christ died needlessly.”
Gal. 5:4. You have been severed from Christ, you who are seeking to be justified by law; you have fallen from grace.
Gal. 5:11. But I, brethren, if I still preach circumcision, why am I still persecuted? Then the stumbling block of the cross has been abolished.
Gal. 6:12. Those who desire to make a good showing in the flesh try to compel you to be circumcised, simply so that they will not be persecuted for the cross of Christ.
13. For those who are circumcised do not even keep the Law themselves, but they desire to have you circumcised so that they may boast in your flesh.
14. But may it never be that I would boast, except in the cross of our Lord Jesus Christ, through which the world has been crucified to me, and I to the world.
15. For neither is circumcision anything, nor uncircumcision, but a new creation.
Rom. 9:30. What shall we say then? That Gentiles, who did not pursue righteousness, attained righteousness, even the righteousness which is by faith;
31. but Israel, pursuing a law of righteousness, did not arrive at
that law.
32. Why? Because
they did not
pursue it by faith, but as though
it were by works. They stumbled over the stumbling stone,
33. just as it is written, "BEHOLD, I LAY IN ZION A STONE OF STUMBLING AND A ROCK OF OFFENSE, AND HE WHO BELIEVES IN HIM WILL NOT BE DISAPPOINTED."
Therefore, the “works” that he wrote of in Eph. 2:9 were not the “good works” that Jesus taught one must perform to be justified and saved (Matt. 16:27, 25:34-46; Mark 10:17-30; Luke 10:25-37; John 5:28-29) or the good works that James taught one must perform to be justified and saved (James 2:14-26) or the good works that we read of in the faith chapter in the New Testament (Heb. 11), but works of the Law and circumcision in particular. (continued in the following post)
James, in his epistle, approached the matter from a very different perspective; that is, he vigorously taught that works are essential for ones justification and salvation, but he was not writing of circumcision or any other work of the Law, but exclusively the good works that Jesus commands us to perform.
When we carefully read Eph. 2:8-9 in the context of 8-16 (see below), we see (especially in verse 11, but also in the context), that Paul is explaining to the Christians in Ephesus that a Gentile could become a Christian without keeping the Law, specifically without being circumcised.
Ephesians 2:8. For by grace you have been saved through faith; and that not of yourselves,
it is the gift of God;
9. not as a result of works, so that no one may boast.
10. For we are His workmanship, created in Christ Jesus for good works, which God prepared beforehand so that we would walk in them.
11. Therefore remember that formerly you, the Gentiles in the flesh, who are called “Uncircumcision” by the so-called “Circumcision,”
which is performed in the flesh by human hands—
12.
remember that you were at that time separate from Christ, excluded from the commonwealth of Israel, and strangers to the covenants of promise, having no hope and without God in the world.
13. But now in Christ Jesus you who formerly were far off have been brought near by the blood of Christ.
14. For He Himself is our peace, who made both
groups into one and broke down the barrier of the dividing wall,
15. by abolishing in His flesh the enmity,
which is the Law of commandments
contained in ordinances, so that in Himself He might make the two into one new man,
thus establishing peace,
16. and might reconcile them both in one body to God through the cross, by it having put to death the enmity.
When Eph. 2:8-9 is read apart from both the literary and historical context in which it was originally written, it can appear to teach precisely the opposite of what Jesus and James taught—a doctrine that was entirely foreign to the teaching of Paul and a doctrine that has nothing at all to do with Paul’s goal and objective of explaining to both the Jews and Gentiles the mystery that a Gentile could become a Christian without keeping the Law, specifically without being circumcised. (Paul used the word “circumcision”—in our English translations—30 times in 26 verses, and the word “circumcised” 11 times in 9 verses).
We read in the New Testament that both the grace by which we are saved and the faith through which we are saved are gifts from God, but in order to be saved, we must allow both the grace and the faith to work in our lives, and that includes performing the works that Jesus and His brother James taught we must perform to be justified and saved.
(All Scripture quotations are from the NASB, 1995, unless otherwise noted)