My little children, for whom I am again in the anguish of childbirth until Christ is formed in you! 20 I wish I could be present with you now and change my tone, for I am perplexed about you. 21 Tell me, you who desire to be under the law, do you not listen to the law? 22 For it is written that Abraham had two sons, one by a slave woman and one by a free woman. 23 But the son of the slave was born according to the flesh, while the son of the free woman was born through promise. 24 Now this may be interpreted allegorically: these women are two covenants. One is from Mount Sinai, bearing children for slavery; she is Hagar. 25 Now Hagar is Mount Sinai in Arabia; she corresponds to the present Jerusalem, for she is in slavery with her children. 26 But the Jerusalem above is free, and she is our mother. 27 For it is written, “Rejoice, O barren one who does not bear; break forth and cry aloud, you who are not in labor! For the children of the desolate one will be more than those of the one who has a husband.” 28 Now you, brothers, like Isaac, are children of promise. 29 But just as at that time he who was born according to the flesh persecuted him who was born according to the Spirit, so also it is now. 30 But what does the Scripture say? “Cast out the slave woman and her son, for the son of the slave woman shall not inherit with the son of the free woman.” 31 So, brothers, we are not children of the slave but of the free woman.
Paul is masterfully using “the Law” in the sense of what was called “the book of the law” also known as “the pentateuch” that is, the first 5 books of the bible, against the false teachers who were so dependent on quoting from those books.
He uses the example of Isaac and Ishmael. God had promised Abraham that he was going to have a son by Sarah his wife even though both of them were very old and had never been able to have children. Abraham believed God. But there was a period where Abraham, in weakness, perhaps despairing because God was taking so long, listened to Sarah his wife and went in to Sarah’s servant Hagar. Hagar conceived and bore a son named Ishmael. This was the son “of the flesh” as Paul says because it was the son whom Abraham had conceived through the manipulation and “works” of the sinful nature. But Isaac, whom God later gave to Abraham and Sarah was the Son of promise because his birth was not according to the works of man but to the miraculous, gracious, work of God.
So it is with all who believe in Christ. They are justified, not because of their manipulations, not because of anything they do to try to get God to like them but only through the gracious, miraculous work of God in sending Jesus, THE Child of promise and working faith in our hearts to make us heirs with Christ and children of Abraham.