Paul writes Galatians to save these young congregations in Asia Minor from apostasy. A group of false teachers had arrived in southern Galatia and were teaching a different gospel. They mixed law and grace. While they taught that you could be saved by trusting in Christ's death and resurrection, they added "you must also keep the Law of Moses," including be circumcised, keep the Sabbath, observe the festivals, and practice the dietary laws.
This is why the theme of his letter to the Galatian churches is salvation by grace alone, through faith alone, in Christ alone, to God's glory alone