וְאֵ֤לֶּה הַגּוֹיִם֙ אֲשֶׁ֣ר הִנִּ֣יחַ יְהוָ֔ה לְנַסּ֥וֹת בָּ֖ם אֶת־יִשְׂרָאֵ֑ל אֵ֚ת כָּל־אֲשֶׁ֣ר לֹֽא־יָדְע֔וּ אֵ֖ת כָּל־מִלְחֲמ֥וֹת כְּנָֽעַן׃
Inilah bangsa-bangsa yang dibiarkan tinggal oleh Yang Mahakekal untuk menguji orang Israel dengan mereka, yaitu semua orang yang tidak mengalami segala peperangan di Kanaan;
Rashi
So that Yisroel would be tested through them. This was a different generation, ignorant of the miracles of the Canaanite wars, and not having witnessed the great deeds, they rebelled, and betrayed the Omnipresent.
Metzudat David
These are the incoming generations that did not know that they should make known all of the miracles that were done for Yehoshua at the time that they fought Canaan. And because of this, they become weak in their faith in Hashem. And for that, these nations were place to test them