These two women and their sons express an allegory and become symbols of two covenants. The first covenant was born on Mount Sinai, birthing children into slavery—children born to Hagar.
Because she pleased Pharaoh, Abram got along very well in Egypt and received royal treatment: he was given sheep, cattle, male and female donkeys, camels, and male and female slaves.
Now, Rebekah was unable to have children, but Isaac pleaded with Yahweh on behalf of his wife because she was barren—and she did get pregnant, for Yahweh responded to Isaac’s prayer.
God spoke to Abraham, “Don’t be distressed over the slave woman and her son. Listen to every word Sarah says to you, and do it, for it will be through Isaac your promise of descendants will be fulfilled.