“Then we turned, and took our journey into the wilderness by the way of the Red sea, as the LORD spake unto me: and we compassed mount Seir many days.” (Deuteronomy 2:1)
Israel’s stay at Kadesh Barnea and refusal to go into Canaan gave the Canaanites time to gather and get assistance from the Amorites, thus defeating Israel. As a result Israel was forced to withdraw to the southeast to the gulf of Aqaba on the Red Sea. Because both the Moabites and the Edomites refused them permission to enter their land, they spent the next thirty eight years roaming the desert south and east of the Edomite land known as Seir, traveling as far south as mount Hor(Sinai) and Rephidim.
“And the LORD spake unto me, saying, Ye have compassed this mountain long enough: turn you northward. And command thou the people, saying, Ye are to pass through the coast of your brethren the children of Esau, which dwell in Seir; and they shall be afraid of you: take ye good heed unto yourselves therefore: Meddle not with them; for I will not give you of their land, no, not so much as a foot breadth; because I have given mount Seir unto Esau for a possession.
Ye shall buy meat of them for money, that ye may eat; and ye shall also buy water of them for money, that ye may drink. For the LORD thy God hath blessed thee in all the works of thy hand: he knoweth thy walking through this great wilderness: these forty years the LORD thy God hath been with thee; thou hast lacked nothing.” (Deuteronomy 2:2-7)
After thirty eight years, during which the older men all died, God directed Israel to again go north, but not to bother the Edomites in Seir, the descendants of Esau. The land of Seir had been given to Esau and was to be theirs. Israel was to buy any bread or water they obtained from the Edomites, because God had blessed them during the forty years, and they were to show that in their treatment of the Edomites. Israel went along the eastern border of the Edomite land to the wilderness area on the east edge of Moab.
“And when we passed by from our brethren the children of Esau, which dwelt in Seir, through the way of the plain from Elath, and from Eziongaber, we turned and passed by the way of the wilderness of Moab. And the LORD said unto me, Distress not the Moabites, neither contend with them in battle: for I will not give thee of their land for a possession; because I have given Ar unto the children of Lot for a possession.
The Emims dwelt therein in times past, a people great, and many, and tall, as the Anakims; Which also were accounted giants, as the Anakims; but the Moabites call them Emims. The Horims also dwelt in Seir beforetime; but the children of Esau succeeded them, when they had destroyed them from before them, and dwelt in their stead; as Israel did unto the land of his possession, which the LORD gave unto them.” (Deuteronomy 2:8-12)
God also forbade taking the land from the Moabites because they were descendants of Lot. Both the Moabites and Edomites had previously refused permission to enter the land, but now they were afraid even to refuse permission. Both groups had taken the land from previous occupants, including a race of giants known as the Emims.
“Now rise up, said I, and get you over the brook Zered. And we went over the brook Zered. And the space in which we came from Kadeshbarnea, until we were come over the brook Zered, was thirty and eight years; until all the generation of the men of war were wasted out from among the host, as the LORD sware unto them. For indeed the hand of the LORD was against them, to destroy them from among the host, until they were consumed.
So it came to pass, when all the men of war were consumed and dead from among the people, That the LORD spake unto me, saying, Thou art to pass over through Ar, the coast of Moab, this day: And when thou comest nigh over against the children of Ammon, distress them not, nor meddle with them: for I will not give thee of the land of the children of Ammon any possession; because I have given it unto the children of Lot for a possession.
(That also was accounted a land of giants: giants dwelt therein in old time; and the Ammonites call them Zamzummims; A people great, and many, and tall, as the Anakims; but the LORD destroyed them before them; and they succeeded them, and dwelt in their stead: As he did to the children of Esau, which dwelt in Seir, when he destroyed the Horims from before them; and they succeeded them, and dwelt in their stead even unto this day: And the Avims which dwelt in Hazerim, even unto Azzah, the Caphtorims, which came forth out of Caphtor, destroyed them, and dwelt in their stead.)” (Deuteronomy 2:13-23)
The Ammonites, also descendents of Lot lived next to the Moabites, and Israel was not to disturb them either. Their land had also originally been inhabited by a race of giants.