Here God is, promising Abram a huge family over and over again (13:16; 15:5), but his wife Sarai has not yet born a child. That is simply a big fat contradiction.
Sarai takes matters into her own hands and offers her slave girl to Abram. They'll produce an heir this way.
This is essentially old fashioned surrogacy. Such arrangements are well-attested in other ancient Mesopotamian legal texts, too. No big deal.
Sarah's servant Hagar becomes pregnant. Now Hagar is no longer a slave, but a wife. And she's the wife with the baby. So Hagar is feeling pretty good about herself, and she "looked with contempt upon" Sarai (16:4 NRSV).
Sarai feels slighted and blames Abram for the whole situation. Abram's response? He passes the buck back to Sarai. She can do whatever she wants with Hagar.
Sarai mistreats Hagar, reminding her who's boss, so Hagar runs away to escape the miserable situation.
The deity's emissary finds her by a spring of water in Shur headed south, probably back to Egypt, her home country (see 16:3).
The messenger addresses her as Hagar, and then reminds her of her proper place when he calls her the "slave-girl of Sarai" (16:8 NRSV). He wants to know where she's come from and where she's going.
She responds that she's trying to escape her "mistress" Sarai. Hagar doesn't deny she's a slave.
The deity's envoy commands her to return and "submit" to Sarai. The messenger's no advocate on behalf of abused women here—hard to swallow in modern times, that's for sure.
But the envoy does lift her prospects somewhat when he promises that she'll spawn numerous offspring, beyond counting. Kind of like the promise God made to Abram in 13:16 and 15:5, right?
The messenger continues that she'll have a son, whom she's supposed to name Ishmael, "for the Lord has given heed" to Hagar's suffering. The Hebrew for "give heed" (sham'a) sounds like Ishmael.
He sure will be one "wild ass of a man" (16:12 NRSV). That's really what it says, no joke.
Hagar gives a new name to the deity: "El-roi," which she explains with the question, "Have I really seen God and remained alive after seeing him?" (16:13 NRSV).
And that's why the well where this occurred is called—get ready for a mouthful—Beer-lahai-roi. Try saying that five times fast.