Rabbi Joshua ben Ḳorchah said: Because of his love for her, (Pharaoh) wrote in her marriage document (giving her) all his wealth, whether in silver, or in gold, or in man-servants, or land, and he wrote (giving) her the land of Goshen for a possession. Therefore the children of Israel dwelt in the land of Goshen, in the land of their mother Sarah. He (also) wrote (giving) her Hagar, his daughter from a concubine, as her handmaid.

And whence do we know that Hagar was the daughter of Pharaoh? Because it is said, "Now Sarai Abram's wife bare him no children; and she had an handmaid, an Egyptian, whose name was Hagar" (Gen. 16:1). Pharaoh rose up early in the morning confused because he had not approached her, and he sent and called Abraham, and said to him: Behold, Sarai thy wife is before thee, and all the deeds of her marriage contract are with her, take (her) and go, do not tarry in this land, as it is said, "Now therefore behold thy wife, take her, and go" (Gen. 12:19).

"And Pharaoh gave men charge concerning him, and they sent him forth" (Gen. 12:20). And he had Abraham led so as to come to the land of Canaan. He sojourned in the land of the Philistines in order to be refreshed there. And he went away.

And everything is foreseen by the Holy One, blessed be He, and Abimelech sent and took Sarah, thinking to raise up children from her, as it is said, "And Abimelech… sent, and took Sarah" (Gen. 20:2).