Paul defends his gospel, the true gospel of Jesus Christ, to bring the Galatians back to understanding their faith. He continues to tell his testimony and ministry experiences to show his authority. On his second trip to Jerusalem, Paul met with the apostles there, and they had a council where they defended the gospel of grace and faith. Peter was very outspoken that salvation came to all people the same way—by grace through faith.
Some of the believing Pharisees attending the council wanted Gentiles to follow the law and become circumcised, but the council rejected this. In spite of what Peter said at the Jerusalem council, he later showed hypocrisy by avoiding fellowship with the Gentile believers because they did not keep Jewish religious rules. Paul publicly rebuked Peter, reminding him that the gospel is through faith in Jesus, and only through faith. It seems likely that the consensus reached at the Jerusalem council in the presence of Paul had been undermined, and Paul was having to defend the gospel of grace once again, when it ought to have been settled. But Paul willingly continues to defend the gospel in this epistle, for that is the ministry he was given from God.