Genesis 15 through 18 concerns itself with Abram’s covenant with YHWH, which is first revealed to Abram in a vision. Abram is skeptical, since he has no sons to inherit anything, and any rewards would need to be bestowed on his distant relatives. In Genesis 15 YHWH spends most of the time convincing Abram that he is entitled to a reward, and that he will have many offspring upon whom to confer these rewards. To prove it, YHWH has Abram bring a heifer, a goat, and a ram, plus a dove, and a pigeon, which Abram ritually sacrifices, then waits to see what will happen. Rather than seeing something like a burning bush, instead, as night falls, Abram falls asleep, and experiences another vision, in which YHWH elaborates on the reward.
Here Abram is told his descendants will be enslaved in a foreign country for four hundred years, and after four generations, they’ll escape and then take possession of the land of Canaan. They have to wait until the fourth generation, because the sin of the Amorites hasn’t reached its full measure, but it’s not explained why that’s a factor. Once again, we’re confronted with the curious genealogical timelines of Genesis, since four generations should be, at most, a hundred and twenty years, not four hundred. In the meantime, Abram will die at a very old age, and go to his ancestors. Exactly how this is supposed to be comforting to Abram is not really spelled out, except to assure him that he will have descendants to take advantage of all these promises.
Not wanting to wait, Abram takes Sarai up on her offer to have relations with her Egyptian slave Hagar. Once Hagar is pregnant, however, things deteriorate between her and Sarai, who states her case to Abram, and he gives her leave to deal with Hagar as she chooses. This causes Sarai to mistreat Hagar and drive her into the dessert. There, an angel finds Hagar and inquires why she’s there. After hearing Hagar’s complaints, the angel sends her back, but assures her that her son will also be the father of many descendants. The angel’s words aren’t very reassuring, though, as it describes her son, who she’ll call Ishmael, as a “wild donkey of a man” who will “live in hostility” with Abram’s other descendants. It’s helpful to remember here that this part of Genesis was most likely written by someone who claimed descent from these other descendants, who, presumably, weren’t getting along well with those who claimed descent from Ishmael. Once again, it appears YHWH is favoring the younger son, since Ishmael is the first-born. Genesis 16 concludes by telling us that Abram was eighty-six when Ishmael was born.
Much of YHWH’s covenant with Abram, up to this point, seems to have consisted of YHWH promising Abram over and over that his descendants will inherit the land of Canaan. In Genesis 17, however, YHWH finally gets around to sealing the deal with Abram, who’s described as being ninety-nine years old at the time. After reiterating everything that’s been said before, YHWH changes Abram’s name to Abraham, and says Abraham and all males who are in any way part of his household must be circumcised, which is probably the last thing a ninety-nine year old guy wants to hear, but Abraham doesn’t object. It’s not specifically stated why YHWH insists on circumcision, and it’s possible this was an attempt by whoever wrote this part of Genesis to explain the practice among Israelites, or, it may have been a practice attributed to Abraham in the legends passed down in the tribes, or it could be another case of deriving an “ought” from an “is” namely, since Israelites practiced circumcision, it must have been ordained by a higher power. In any event, YHWH’s not finished, and tells Abraham that his wife is now to be called Sarah, and that she’ll have a son, even though she’s well past the age to give birth. Abraham questions this, but is assured it will happen. Abraham is to call the son Isaac, and Abraham is told that the covenant will extend to Isaac as well. Finished with all the deal-making, YHWH takes off, leaving Abraham to carry out his side of the covenant, which he does without further discussion.
Finally, in Genesis 18, YHWH drops by for a chat, but then Abraham is visited by three men at his tent, so he immediately goes into gracious host mode, asking them to sit in the shade while he brings water for them to wash their feet. He instructs Sarah to make bread, and has animals slaughtered to provide food for them. While they’re eating, they inquire about Sarah, then tell Abraham that when they return, she’ll have given birth to a son. Sarah hears them and finds the whole idea amusing, since she’s well beyond the age a woman can give birth, but YHWH hears her laugh and questions why she’s laughing. She tries to deny she laughed, but YHWH says she did. Nothing seems to come from it, however, because the men apparently have other business more pressing, as we’re about to learn.
Finished eating, the three visitors get up to go, then turn their eyes toward Sodom and Gomorrah, and as we already know that’s not going to end well. YHWH clues Abraham in on what’s in store for the two cities, and Abraham tries to bargain with YHWH, first gaining an agreement not to destroy the city if fifty righteous people can be found there, then narrowing the number down to forty-five, then forty, and so on, down to ten. The haggling seems to be intended to show Abraham’s close relationship with YHWH, since it’s doubtful YHWH would have put up with it if anyone else tried it. Abraham should have just saved his time and effort and asked YHWH to get Lot out of there, since his nephew apparently didn’t learn anything from his last calamity when Abram had to save him, and let the other residents fend for themselves, but that’s a story for another day.