Because of their disobedience, the Israelites head back toward the Red Sea in the opposite direction of the Promised Land (1).
The Israelites avoid Mt. Seir until God tells them to head in that direction. When they do, they are united with some long lost cousins, the descendants of Esau (Jacob's brother from Genesis).
The Lord tells the wandering Israelites to buy food and water from these people and not to incite any kind of violence.
If this reminds you of Jacob selling a bowl of soup to Esau back in Genesis, you're a smart cookie. The idea is that some people are commercial partners for the Israelites (these guys), while some people are just plain evil.
Next, the Israelites pass through Moabite territory. The Moabites are the descendants of Lot, the nephew of Abraham. Back in Genesis, he and Abraham parted ways, but they're still distantly related.
Blood counts for a lot in the Bible. The Israelites are not supposed to bother the Moabites because God has given this land to them as descendants of Lot. Both the Edomites and the Moabites have received their land, but the Israelites must continue wandering (9).
Basically, the text is telling us that this is common practice among the powerful and the vassals. You claim a family status (as a descendant of Lot, Esau, etc.), and God gives you some land that you have to take from whoever is currently living on it.
This gets rid of the Godless people and makes everyone happy.
The Israelites just have to take a very long road—you know, because of that evil generation.
The writer now inserts an editorial note about the Emim, a tall and powerful people who used to live in the land of the Moabites. We know that a writer from a later period in history inserted this note because he also talks about Israel driving people out of their Promised Land, which, at this point in the narrative story, hasn't even happened yet (10-12). Oops!
To make a long story a little bit shorter, thirty-eight years pass by in two verses. The generation of warriors who were afraid to take the land die—except for Joshua and Caleb. The Lord even speeds up their deaths as punishment for their lack of loyalty to God (13-15).
God is a vengeful character, everyone. Watch out.
The Israelites head back toward the Promised Land. But this time, they're told not to attack the Ammonites because God has given them their land. Like the Moabites, the Ammonites were the descendants of Lot.
Just like in verses 10-12, the writer quickly interrupts the story to provide us with a history lesson. The narrator tells about the Ammonites taking the land of those giant people known as the Anakim. And, just for good measure, the narrator again reminds the people of the conquests of the Edomites (20-23).
The text is super repetitive, but it coolly gives the modern reader an idea of the context of the history; we may not have details on the finer cultural exports of the Edomites, but the readers of ancient times would have had all the deets.
Next up, the Lord tells the Israelites to attack King Sihon the Amorite. God wants to use this battle to make the reputation of Israel spread throughout the land and cause their enemies to fear them (24-25).
Before attacking Sihon, the Israelites offer him a peace treaty. (Check out Deuteronomy 20:10-12 for some not-so-interesting laws concerning peace treaties.)
They assure him that they only want to pass through the land and buy food and water. Hey, they've already made a similar deal with the Edomites, so why shouldn't Sihon trust them? Sihon refuses their offer because God hardens his heart—just like he hardened Pharaoh's heart a zillion times in Exodus. Kind of makes you wonder about free will, right?
The point is that God constantly feels the need to prove his power, and he uses his superpower of "hardening people's hearts" to start fights he knows he can win. Morally messy, but it would make a great movie. And it sure makes a great story.
The people destroy Sihon and kill all of the men, women, and children. There is not a single survivor left, but the Israelites are allowed to keep livestock and plunder.
This is one of the first times we start asking serious ethical questions in Deuteronomy.