Gal 3:
3 O foolish Galatians! Who has bewitched you [
a]that you should not obey the truth, before whose eyes Jesus Christ was clearly portrayed among you as crucified? 2 This only I want to learn from you: D
id you receive the Spirit by the works of the law, or by the hearing of faith? 3 Are you so foolish? Having begun in the Spirit, are you now being made perfect by the flesh? 4 Have you suffered so [
c]many things in vain—if indeed
it was in vain?
5 Therefore He who supplies the Spirit to you and works miracles among you,
does He do it by the works of the law, or by the hearing of faith?— 6 just
as Abraham “believed God, and it was accounted to him for righteousness.” 7 Therefore
know that only those who are of faith are sons of Abraham. 8 And the Scripture, foreseeing that God would justify the Gentiles by faith, preached the gospel to Abraham beforehand,
saying, “In you all the nations shall be blessed.” 9 So then those who
are of faith are blessed with believing Abraham.
The Law Brings a Curse
10
For as many as are of the works of the law are under the curse; for it is written, “Cursed is everyone who does not continue in all things which are written in the book of the law, to do them.” 11 But that no one is [d]justified by the law in the sight of God is evident, for “the just shall live by faith.”
13
Christ has redeemed us from the curse of the law, having become a curse for us (for it is written, “Cursed is everyone who hangs on a tree”), 14 that the blessing of Abraham might come upon the Gentiles in Christ Jesus, that we might receive the promise of the Spirit through faith.
9 What
purpose then does the law serve? It was added because of transgressions, till the Seed should come to whom the promise was made; and it was appointed through angels by the hand of a mediator. 20 Now a mediator does not
mediate for one
only, but God is one.
21
Is the law then against the promises of God? Certainly not! For
if there had been a law given which could have given life, truly righteousness would have been by the law. 22 But the Scripture has confined all under sin, that the promise by faith in Jesus Christ might be given to those who believe. 23 But
before faith came, we were kept under guard by the law, [f]kept for the faith which would afterward be revealed. 24 Therefore the law was our [g]tutor to bring us to Christ, that we might be justified by faith. 25 But after faith has come, we are no longer under a tutor.
James 2:10
For
whoever shall keep the whole law, and yet
stumble in one point, he is guilty of all.
The law is a generic term, there is not one size fits all, the context determines which law.
In Galatians the law is referring to
circumcision if one wants to read it context.
2 Then after fourteen years I went up again to Jerusalem with Barnabas, and also took Titus with
me. 2 And I went up [
a]by revelation, and communicated to them that gospel which I preach among the Gentiles, but privately to those who were of reputation, lest by any means I might run, or had run, in vain. 3
Yet not even Titus who was with me, being a Greek, was compelled to be circumcised. 4 And
this occurred because of false brethren secretly brought in (who came in by stealth to spy out our liberty which we have in Christ Jesus, that they might bring us into bondage), 5 to whom we did not yield submission even for an hour, that the truth of the gospel might continue with you.
6 But from those who seemed to be something—whatever they were, it makes no difference to me; God [
b]shows personal favoritism to no man—for those who seemed
to be something added nothing to me. 7 But on the contrary, when they saw that the gospel for the
uncircumcised had been committed to me, as
the gospel for
the circumcised was to Peter 8 (for He who worked effectively in Peter for the apostleship to the
circumcised also worked effectively in me toward the Gentiles), 9 and when James, [
c]Cephas, and John, who seemed to be pillars, perceived the grace that had been given to me, they gave me and Barnabas the right hand of fellowship, that we
should go to the Gentiles and they to the
circumcised. 10
They desired only that we should remember the poor, the very thing which I also was eager to do.
11 Now when Peter had come to Antioch, I withstood him to his face, because he was to be blamed; 12 for before certain men came from James, he would eat with the Gentiles; but when they came, he withdrew and separated himself, fearing [
f]those who were of the
circumcision. 13 And the rest of the Jews also played the hypocrite with him, so that even Barnabas was carried away with their hypocrisy.
14 But when I saw that they were not straightforward about the truth of the gospel, I said to Peter before
them all, “If you, being a Jew, live in the manner of Gentiles and not as the Jews, why do you compel Gentiles to live as [
h]Jews? 15 We
who are Jews by nature, and not sinners of the Gentiles, 16 knowing that a man is not justified by the works of the law but by faith in Jesus Christ, even we have believed in Christ Jesus, that we might be justified by faith in Christ and not by the works of the law; for by the works of the law no flesh shall be justified.
17 “But if, while we seek to be justified by Christ, we ourselves also are found sinners,
is Christ therefore a minister of sin? Certainly not! 18 For if I build again those things which I destroyed, I make myself a transgressor. 19 For I through the law died to the law that I might live to God. 20 I have been crucified with Christ; it is no longer I who live, but Christ lives in me; and the
life which I now live in the flesh I live by faith in the Son of God, who loved me and gave Himself for me. 21 I do not set aside the grace of God; for if righteousness
comes through the law, then Christ died in vain.”
Circumcision was the "works of the law" that Gentiles needed to be circumcised to receive the gospel. Paul was rebuking this teaching. He also said 1 Cor 7:19 Circumcision is nothing and uncircumcision is nothing,
but keeping the commandments of God is what matters.
James is referring to the Ten Commandments
James 2: 10
For whoever shall keep the whole law, and yet stumble in one point, he is guilty of all. 11 For He who said, “
Do not commit adultery,” also said,
“Do not murder.” Now if you do not commit adultery, but you do murder, you have become a transgressor of the law. 12 So speak and so do as those who will be judged by the law of liberty.
James is only contrasting and quoting the Ten Commandments.
Not all the laws are the same. God only spoke and wrote the Ten Commandments- God is perfect, therefore He could only write a perfect law Psa 19:7 and God does not make mistakes, people do, not God.