Moses has been speaking of the years Israel spent in the wilderness. The wilderness years are about to come to a conclusion because all the men who were twenty years or more who came out of Egypt have passed on with the exception of Joshua and Caleb.
You'll recall that the Edomites, relatives of the Israelites through Jacob's brother Esau, did not treat the Israelites kindly when they requested passage through Edomite territory on their way to the promised land. The Edomites refused them entry and the Israelites had to go the long way around. But the Lord made sure the Israelites had everything they needed, as Moses pointed out yesterday, saying, "These forty years the Lord your God has been with you, and you have not lacked anything."
Moses continues, "So we went on past our relatives the descendants of Esau, who live in Seir. We turned from the Arabah road, which comes up from Elath and Ezion Geber, and traveled along the desert road of Moab." (Deuteronomy 2:8)
The Lord told the Israelites that none of the territory inhabited by the Edomites was to be theirs as part of the promised land. Although Esau lost his birthright due to his own foolish decisions, his descendants are still the kinsmen of the descendants of Jacob. The Lord didn't give Israel permission to take anything from them.
The Lord also told the Israelites that the land of their kinsmen the Moabites won't be part of the promised land either. "Then the Lord said to me, 'Do not harass the Moabites or provoke them to war, for I will not give you any part of their land. I have given Ar to the descendants of Lot as a possession." (Deuteronomy 2:9) They aren't to try to take Ar from the Moabites because the Moabites are related to them through Abraham's nephew Lot.
The Moabites were a people who didn't treat them kindly. As you'll recall, the Moabites and their neighbors the Midianites wanted to drive the Israelites away and they hired Balaam the prophet to curse Israel. But Balaam was unable to fulfill their request so the Midianite women seduced some of the Israelite men into idolatry through sexual allure, hoping to bring about their military downfall through a spiritual downfall. Still, the Lord marked out a specific territory for the Moabites and instructed Israel not to touch it.
At one time giants lived in the region of Ar. The following footnote about them has been added: "(The Emites used to live there---a people strong and numerous, and as tall as the Anakites. Like the Anakites, they too were considered Rephaites, but the Moabites called them Emites.)" (Deuteronomy 2:10-11) The Rephaites (Rephaim) are believed to have been men of more than average height, and they are often referred to as "giants" in the Bible although their name can also mean something like "terrible ones" or "great ones". In addition, the word "rephaim" is sometimes used in the Bible to describe a disembodied spirit or a lost soul because this word became synonymous with something to be feared. I do believe it's proper to translate references to the Rephaim as "giants" because otherwise Moses would not point out their tallness, saying they were "as tall as the Anakites". The ten Israelite spies who brought back a negative report about the land of Canaan said they saw Anakites there and that these people were "stronger and taller than we are" and that in comparison to the Anakites "we seemed like grasshoppers".
The Emites used to live in the territory of Ar. What happened to them? Apparently the Moabites drove them out and took their land, although the Bible doesn't specifically say so. I believe this is implied because this same passage mentions a group of people the Edomites drove out. "(Horites used to live in Seir, but the descendants of Esau drove them out. They destroyed the Horites from before them and settled in their place, just as Israel did in the land the Lord gave them as their possession.)" (Deuteronomy 2:12) Verses 10-12 seem to be saying, "The Moabites drove the Emites out of Ar and settled in their place, just as the Edomites drove the Horites out of Seir and settled in their place."
We know very little about the Horites as they are mentioned only in the books of Genesis and Deuteronomy. It's possible they were giants since they are mentioned in the same passage as the Rephaites. If this is the case, even though the Edomites and the Moabites treated the Israelites poorly, the Israelites benefited from some of their actions. If the Rephaites and Horites had not been driven out of the hill country of Seir and the plains of Moab at some time prior to Israel's emergence from Egypt, these giants would almost certainly have attacked the Israelites as they passed through the region. Several times now the hardships of the journey have caused a large number of Israelites to want to turn back to Egypt. Imagine how much more they'd have wanted to turn back to Egypt if giants opposed them in the wilderness! It's one thing to fight giants once Israel is already across the border of the promised land; it's a far different thing to face giants before they ever lay eyes on the land flowing with milk and honey. Once in the land they'll know what they're fighting for but right now it's hard to picture the goodness of the land in their minds. The people will have far more incentive to fight with all they've got once their boots hit the ground in Canaan. The Lord lovingly spared the Israelites from dealing with the Rephaim and the Horites on their way through the wilderness and He used people who aren't kindly disposed toward them (the Moabites and the Edomites) to do it.
I'm reminded of something King Solomon once said, "When the Lord takes pleasure in anyone's way, He causes their enemies to make peace with them." (Proverbs 16:7) The Moabites and Edomites were not friends of Israel and did not make a peace treaty with Israel, but they accidentally did good things for Israel by driving giants from the area before the Israelites got there. The Lord can cause us to profit from the actions of our enemies, even in cases where our enemies deliberately set out to harm us. As Jacob's son Joseph said to the brothers who once hated him and sold him into slavery, "You intended to harm me, but God intended it for good." (Genesis 50:20)
I'll close with a personal story. Earlier this year my husband and several other employees at his workplace were unexpectedly let go. Now, a thing like that is understandable in these hard times because apparently the company had lost revenue several months in a row---significant amounts of revenue---likely due to the pandemic which brought about tough economic times and caused people to not buy nearly as much of the product that this company makes. Vast numbers of our fellow citizens have been laid off work since the arrival of the pandemic. But what was different at my husband's workplace is that the owner (a person who regularly demonstrated his unscrupulous character and who spoke to the employees in ways no one should ever speak to anyone) didn't want to incur any of the expenses of unemployment benefits. If you have time and are unfamiliar with how layoffs cost employers money, you can google how this works. I was somewhat aware it cost money but didn't understand how it works til I did an internet search about it. This employer made up reasons to let the employees go so he wouldn't lose any money; losing money was the one thing on his mind all day every day already. He fired all the people he let go instead of laying anyone off, writing up weird and unfounded reasons for their termination. For example, he claimed my husband was looking for other employment while he was on the clock, which was absolutely not the case at all. My husband never did any such thing and couldn't have if he'd wanted to, not having access to his personal email and personal phone, etc. during the workday. Another employee, who had been given permission to work from home because all of his IT duties actually could be done from home, was written up for "working from home too much", claiming they had told him he couldn't. If that had been true they wouldn't have kept paying him during all the months he worked from home, but it's hard to fight claims like this with the unemployment bureau. I could supply other examples of things that happened but you see where I'm going with this. The intent was to lay off a number of employees without it costing the employer a dime because if you're fired you can't draw unemployment benefits.
But what this man intended for evil, the Lord used for good. The Lord gave my husband a new job where the management treats employees with respect. The Lord gave my husband a job where there's a pleasant and helpful atmosphere. The Lord gave my husband a job that pays more and has better benefits. I hope the same is true for all of my husband's former co-workers. My husband's unrighteous former boss did him a favor without meaning to and I think that's probably going to be the case with everyone the man treated poorly.
This was the case with the Moabites and Edomites. They never intended to do Israel a favor. If they could have gone back in time and not driven the Rephaites and Horites from Ar and Seir, perhaps they would have left these giants alone so they could have attacked the Israelites and sent them running back to Egypt. But what's done is done and the very thing the Moabites and Edomites would have liked to see happen (the Israelites driven away) was actually prevented because some time in the past the giants were driven away instead.
Isn't God good? He makes a way for His people. He opens up a way forward where previously there was no way. He parts seas. He moves mountains. He sends giants running out of our paths. When the Lord intends His children to have something, He does whatever has to be done to make sure His children get it, and sometimes this means even our enemies do things that benefit us.