Background on the Letter to the Galatians: This letter is Paul’s only letter without a “thanksgiving” section. Paul has written what we could consider an angry letter to the Galatians; he is mad at them for following a different Gospel than the one he preached to them. They are now following the message of the Judaizers; those who believed to be a Christian one must follow the Jewish Law, including being circumcised and the dietary restrictions. Paul was extremely opposed to the message of the Judaizers, because their message would greatly hinder Gentile conversion. There were plenty of Gentiles who liked the Jewish religion but they did not want to fully convert, because it would require circumcision, which as an adult can be very painful. So these Gentiles would attend Jewish services in the synagogues, worship and pray to God, and they might even follow the dietary laws; they were called God-fearers. Paul’s ministry was mainly directed to the God-fearers, because they knew the Hebrew Scriptures and the Jewish monotheistic beliefs, thus there was a common ground for explaining the life and ministry of Jesus to them. They would have been familiar with the concept of the Jewish Messiah and the belief in resurrection. Unlike the Jewish religion, Christianity allowed them to become part of the fulfillment of the Jewish religion, without having to (in their minds) mutilate themselves. So the problem in Galatia is a group of Judaizers have come in and said that Paul was wrong and they still needed to obey all the Jewish Laws in order to be Christians. In other words, they have to perform certain works to be saved.
Paul starts with telling the Galatians a story about his interactions with St. Peter in Antioch. About how Peter was hanging out with Paul and Barnabas while they were in Antioch (remember that Paul spent around a year in Antioch with Barnabas). Peter was there to affirm that the Holy Spirit was at work in the Gentiles in Antioch. So for some time Peter had eaten with the Gentiles, most likely breaking the dietary laws (this was most likely after Peter’s vision at Cornelius’ house, but before the Council at Jerusalem) and the custom of associating with Gentiles. But some people, who were of the circumcision party and associates with James, the head of the Church in Jerusalem, came to Antioch (most likely an early sect of Judaizers, who probably became Judaizers after the decision at the Council of Jerusalem). Paul lets them know what he told Peter and why they should not be following this message.
Paul goes on to demonstrate how if the Galatians were to follow the Jewish Law that their faith is in vain and their salvation is nothing. He explains that Christ lives in us believers and he is not subject to the Law, because justification does not come through the Law, it comes through belief. Now Paul is not saying that we do not have to perform good works or that we do not need to act rightly (in other words we cannot sin all we want), but instead he is saying trusting in the Law for justification is contrary to the Gospel. He is saying that we cannot trust in anything else but Jesus for salvation and justification.