This was to teach the future generations of the Israelites [how to fight in] battle, especially those who had not fought before.
References for Judges 3:2
[These nations included:] the five rulers of the Philistines and all of the Canaanites, the Sidonians, and the Hivites who lived in the Lebanese mountains from Mount Baal-hermon as far as the entrance to Hamath.
References for Judges 3:3
The Lord left them to test Israel, to determine if they would keep the Lord's commands He had given their fathers through Moses.
References for Judges 3:4
But they settled among the Canaanites, Hittites, Amorites, Perizzites, Hivites, and Jebusites.
The Israelites took their daughters as wives for themselves, gave their own daughters to their sons, and worshiped their gods.
References for Judges 3:6
The Israelites did what was evil in the Lord's sight; they forgot the Lord their God and worshiped the Baals and the Asherahs.
References for Judges 3:7
The Lord's anger burned against Israel, and He sold them to Cushan-rishathaim king of Aram of the Two Rivers,and the Israelites served him eight years.
References for Judges 3:8
The Israelites cried out to the Lord. So the Lord raised up Othniel son of Kenaz, Caleb's youngest brother as a deliverer to save the Israelites.
References for Judges 3:9
The Spirit of the Lord was on him, and he judged Israel. Othniel went out to battle, and the Lord handed over Cushan-rishathaim king of Aram to him, so that Othniel overpowered him.
Then the land was peaceful 40 years, and Othniel son of Kenaz died.
References for Judges 3:11
The Israelites again did what was evil in the Lord's sight. He gave Eglon king of Moab power over Israel, because they had done what was evil in the Lord's sight.
References for Judges 3:12