In the allegory that Paul was using, Hagar represented man's attempt at accomplishing God's promise of a son for Abraham. Sarah represented God's own miraculous method of fulfilling the promise. Paul was trying to convey the difference between God's way of salvation (faith) versus the way that the false teachers were pushing (ritual conversion). Paul continued with this.
Galatians 4:25-31 (KJV)
For this Agar is mount Sinai in Arabia, and answereth to Jerusalem which now is, and is in bondage with her children.
But Jerusalem which is above is free, which is the mother of us all.
For it is written, Rejoice, thou barren that bearest not; break forth and cry, thou that travailest not: for the desolate hath many more children than she which hath an husband.
Now we, brethren, as Isaac was, are the children of promise.
But as then he that was born after the flesh persecuted him that was born after the Spirit, even so it is now.
Nevertheless what saith the scripture? Cast out the bondwoman and her son: for the son of the bondwoman shall not be heir with the son of the freewoman.
So then, brethren, we are not children of the bondwoman, but of the free.
Verse 25 continues Paul's discussion about Hagar (Agar). Although she represented Mount Sinai which is located in Arabia, Mount Sinai answered to Jerusalem, as the location where God placed His name. Paul was using Hagar then as a representative also of Jerusalem, as it was at that time, and the current system of Judaism that placed the Jewish people under a form of bondage. This was what the false teachers wanted the new Galatian believers to submit to.
Paul contrasted the present Jerusalem with the Jerusalem which was above, was free, and was mother of us all (verse 26). This was Sarah in Paul's allegory and she represented the Abrahamic covenant that demonstrated that God's way of salvation was through faith. Notice that Paul claimed that the heavenly (or New) Jerusalem was the mother of us all (the believers, both Jew and Gentile). Paul was not divorcing the believers in Yeshua from Judaism per se, but rather the man-made system surrounding it.
Paul then used Isaiah 54 as the foundation of his allegory (verse 27).
Isaiah 54:1-3 (KJV)
Sing, O barren, thou that didst not bear; break forth into singing, and cry aloud, thou that didst not travail with child: for more are the children of the desolate than the children of the married wife, saith the LORD.
Enlarge the place of thy tent, and let them stretch forth the curtains of thine habitations: spare not, lengthen thy cords, and strengthen thy stakes;
For thou shalt break forth on the right hand and on the left; and thy seed shall inherit the Gentiles, and make the desolate cities to be inhabited.
This prophecy was about Jerusalem, which was described as being barren because her children had gone into exile. However, one day there would be an ingathering of the people, a number far exceeding what she would have expected. In this Millennial Kingdom there would be both Jews and Gentiles.
The comparison of the New Jerusalem to Sarah was in keeping with traditional Jewish interpretation of the barren woman who became the mother of a nation (Lancaster, D.Thomas. The Holy Epistle to the Galatians. First Fruits of Zion, Marshfield, MO, 2011. p. 224).
In verse 28, Paul confirmed that just like Isaac, the believers in Galatia were the children of promise.
Just as Isaac was persecuted by Ishmael, so, too, were the Galatian children of promise persecuted by the children of the flesh (the false teachers) (verse 29). This was a pretty harsh statement about the false teachers. Instead of calling them, brethren, as Paul had been calling the Galatians, he implied that the false teachers would not inherit eternal life! This was confirmed in verse 30, where just as Abraham had been told to cast out Hagar and Ishmael, so, too, the Galatians should cast out the false teachers.
In summary, Paul concluded his allegory by saying that the Galatians were the children of the free woman and not the slave woman (verse 31). There simply was no need for them to undergo ritual conversion and become Jews and be subject to the Judaic system. They were already saved and had entered the Kingdom of God.