Paul is the author of Galatians, and he is writing to people who lived in the area now known as Turkey. He is writing to believers who have had some recent struggles with false teachers. In particular these teachers were known as the Judiazers. They were most likely Jews, who thought of Christianity as a subset of Judaism. They were appalled by Paul's apparent lack of concern for the Torah (Jewish Scriptures), the Jewish rite of circumcision (the sign of the old covenant from Abraham), as well as the traditions and observances of holy days etc.
These teachers were coming into the churches behind Paul and stirring up trouble. They were teaching that in order for someone to be a true Christian, they first had to become a Jew. This was adding to the message of the Gospel. They were saying the salvation was not through faith alone, but instead, it was also through keeping the law and being circumcised. You can imagine how Paul felt about this. This was not just a little issue, this was a matter of life or death for Paul. Literally, people who would believe these teachers would be condemning themselves to hell. So, Paul writes this letter to address the issues at hand! And, he is not happy! Yes, this letter is one of the most harsh letters the apostle writes. He uses very terse language and seems angry... because he is.
Paul's primary purpose in writing this book was to clarify for the churches the relationship between the Christian and the law. Is salvation really by faith, or by works? Paul answers this very clearly by stating "no flesh will be justified by the works of the law" Gal. 2:16. However, he does not just leave it at salvation. He also shows that the same way a person comes into a relationship with the Spirit of God, is the same way he is to live the Christian life. The Christian life is not one where a person is saved by faith, and then attempts to make himself a better Christian by keeping the law! Rather, it is a work of God's grace through the very Gospel by which he was saved! This same Gospel that saves, is the Gospel that sanctifies.