Despite the objections of the Moabites and their attempts to dislodge them, the twelve tribes of Israel continued to camp on the plains of Moab across from Jericho in preparation for the conquest of Canaan (Num 22:1-6).At the instigation of their Midianite allies/overlords, the Moabites successfully enticed the Israelite men to sin against Yahweh and His covenant with Israel by inviting the Israelite men to join in pagan fertility rites for the false god, Baal, worshiped throughout Canaan and on the east side of the Jordan River (Num 25:1-3). Their intrigue so angered God that He sent the righteous Israelite warriors who had resisted the temptations to engage in pagan worship into battle against the Moabites and Midianites who were defeated in a holy war (Num -; 31:1-12).
The events in the story probably occurred about two centuries after the last Israelite war with Moab when the Israelite Judge Ehud, of the tribe of Benjamin, killed Eglon the king of Moab and led the Israelite army in the defeated the Moabite army (Judg -30) and about eighty years before the next war between Moab and Israel (1 Sam ).
Many modern scholars believe that interior dating of the story to a time in the past identified as the age of the Judges and the genealogy in Ruth -22 that ends with the name of David, Israel's second king, suggests that the book was not written until the age of Israel's United Monarchy under the Judahite kings, either during the reign of King David or his son King Solomon but before the Assyrian conquest in 722 BC.
The Moabites had an uneasy and sometimes violent relationship with the children of Israel after the Israelites' exodus from Egypt (Ex ; Num 22-25; 31:1-12; Dt 23:4).
At the end of the Israelites' forty year wilderness journey, the Moabites opposed the Israelites traveling through their lands and camping to the north of their territory along the Jordan River.
You are my rock, my rampart; true to your name, lead me and guide me ...