"And Sarai, Abram's wife, had not borne him [a child]" (Genesis 16:1). The Sages, of blessed memory, said: she had no offspring — that is to say, no womb (literally, "house of offspring"). "And she had a maidservant, an Egyptian, and her name was Hagar" (Genesis 16:1). Pharaoh gave his daughter to Sarai as a maidservant at the time that he took her. And therefore she was called Hagar, for thus he said to Sarai: "Here is your reward" (Hā agrēkh). And likewise Nimrod gave Eliezer his son to Abraham at the time that he was saved from the fiery furnace.
Why Hagar Came to Sarai and Eliezer to Abraham
Midrash Aggadah, Genesis 16:1
ושרי אשת אברם לא ילדה לו. אמרו חז"ל לא היה לה ולד, ר"ל בית ולד: ושמה הגר. פרעה נתן בתו לשרי שפחה בעת שלקחה, ולכך נקראת הגר, כך אמר לשרי הא אגריך, וכן נתן נמרוד אליעזר בנו לאברהם, בשעה שניצל מכבשן האש: