These things may be taken figuratively, for the women represent two covenants.
Paul uses the story of two Old Testament women to illustrate the choice before the Christians of Galatia. The choice is between two extremes. Legalism which leads to slavery or Grace which brings freedom!
God promised Abraham that through his descendants the world would be blessed. This promise was the future coming of Jesus who was born in the lineage of Abraham.
But Abraham, who was married to Sarah, grew to old age without ever having a son. Abraham mistakenly decided to have a son by one of the servants in his household. In due time, Hagar gave birth to Ishmael.
In the course of time, God kept his promise to Abraham. He and Sarah had a son named Isaac.
This resulted in confusion and contention in the household and Abraham sent Hagar and her son away. The child of the slave woman was not to share in the inheritance of the son God promised!
But what does the Scripture say? "Get rid of the slave woman and her son, for the slave woman's son will never share in the inheritance with the free woman's son."
The analogy is perfect. Hagar’s child represents human effort. Sarah’s child was God’s promise, a miracle child born in old age.
Those who taught the necessity of keeping the Law of Moses represented slavery to human effort in order to please God. While Paul’s message of Jesus represents the miracle promise of Jesus’ free gift of salvation.
In this figure, Paul is urging his converts to cast out the teaching of slavery and to continue living in the promise Jesus provides.
Therefore, brothers, we are not children of the slave woman, but of the free woman.