The Galatian Christians were listening to some local preacher, who was telling them that they needed to be circumcised, in addition to trusting in Jesus Christ, to be saved. Paul made it clear to them that circumcision was only one law in a lengthy law (which you can find in Exodus and Leviticus) which condemns us for our failure to keep it perfectly.
Examples of this Jewish error in the Christian history is Roman Catholicism and Eastern Orthodoxy. They both teach that we believe the Gospel so that we may keep the Law. Then, by keeping the Law, combined with the so-called sacraments and the redeeming suffering of Purgatory, we might be saved. In opposition to this ugly message, Paul says that we believe the Gospel instead of keeping the Law.
This is why Paul says that the faith + law message is not from God (v.8). Even just a little pinch of this false teaching was spreading through the whole congregation, and poisoning it (v.9).
Paul expresses confidence that the Lord will keep His children faithful to the Gospel. It is interesting to me that Paul does not express any confidence in the Christians. In fact, he was shocked that they were in the process of defecting from the faith (1:6). But Paul's confidence was in the Lord (v.10a).
This is a fine illustration of Paul believing in God's sovereignty and man's responsibility at the same time. Paul wrote the book of Galatians to keep them anchored in the Gospel. But he is, at the same time, confident in the Lord's power and commitment to make sure they take no other view. He had not changed his message, as it appears someone was claiming (11). If he had changed to a message of faith + works, the false preachers would have stopped persecuting him.
The sovereign Lord of salvation does not allow His true children to completely or permanently defect from the faith. This false gospel of faith + works tests the reality of people's professions of faith, and separates the true wheat from the false tares. A person who knowingly embraces a message of faith + works exposes himself or herself as one who was never truly converted.
Paul expects God's judgment to fall on whoever was the mastermind of this malign influence (v. 10b). In fact, Paul wishes great ill upon the false teachers, by wishing they would not just stop at circumcision and go ahead and completely emasculate themselves (v.12)! This verse illustrates the prophetic severity of the Spirit speaking through the apostle. Verse 12 is a good New Testament example of an Old Testament cursing-psalm.