Judges 3:4

And they were to prove Israel by them, to know whether they would hearken unto the commandments of the LORD, which he commanded their fathers by the hand of Moses.

The surrounding peoples were deliberately left in place to put Israel to the proof, exposing whether they would listen to and obey the commandments of the Lord that had been commanded to their fathers by Moses. That proving was directed to the very place of prior failure, for God brings His people to the test at the points where they have failed before. If they fail under that renewed trial, He may return them to the same test yet again until the lesson is learned.