Judges 2:23

2:23 This is why the Lord permitted these nations to remain and did not conquer them immediately; he did not hand them over to Joshua.

Judges 3:2

3:2 He left those nations simply because he wanted to teach the subsequent generations of Israelites, who had not experienced the earlier battles, how to conduct holy war.