After Abram had lived ten years in the land of Canaan, Abram’s wife Sarai took Hagar the Egyptian, her maid, and gave her to her husband Abram as his wife. He went in to Hagar, and she conceived; and when she saw that she had conceived, her mistress was despised in her sight. And Sarai said to Abram, “May the wrong done me be upon you. I gave my maid into your arms, but when she saw that she had conceived, I was despised in her sight. May the LORD judge between you and me.” But Abram said to Sarai, “Behold, your maid is in your power; do to her what is good in your sight.” So Sarai treated her harshly, and she fled from her presence. Gen. 16:3-6
After Hagar the Egyptian saw that she was pregnant, she despised Sarai. The general opinion of antiquity seems to be that though Hagar was the servant, once she realized she had accomplished what Sarai could not, providing a son, she likely had an heir of superiority over Sarai and looked down upon her. When Abram tells Sarai she must deal with the situation, Sarai decides to treat Hagar harshly.
Friedman’s commentary points out that this is a precursor to a role-reversal in the future: That of Pharaoh and the Egyptians and their harsh treatment of the Israelites. The Hebrew word used here for Hagar’s affliction, inah, is the same word used in Exodus 1:11 describing the hard slave labor of the Israelites under Pharaoh. A reason cited for treating them harshly? They multiplied, (Ex. 1:7) just as Hagar did.
I cannot say for certain whether the similarities between Sarai’s treatment of Hagar and Egypt’s treatment of Israel was divinely planned by God as an eye-for-an-eye punishment of sorts, or just curious happenstance. But it is interesting to consider nonetheless.