רַ֗ק לְמַ֙עַן֙ דַּ֚עַת דֹּר֣וֹת בְּנֵֽי־יִשְׂרָאֵ֔ל לְלַמְּדָ֖ם מִלְחָמָ֑ה רַ֥ק אֲשֶׁר־לְפָנִ֖ים לֹ֥א יְדָעֽוּם׃
בלױז כּדי די דורות פֿון די קינדער פֿון ישׂראל זאָלן װיסן, זײ צו לערנען מלחמה–די װאָס האָבן נאָך פֿריער דערפֿון ניט געװוּסט;
Rashi
Only so that they should know. For this alone, He permitted these nations to remain, so that future generations of the Bnei Yisroel might grasp the consequence of iniquity—for it was now necessary for them to undergo martial training.
Metzudat David
ONLY SO THAT THEY SHOULD KNOW: It wants to teach that only because of this they will become aware of the wonders of the miracles that were done for them since then
Metzudat David
צוטריטלעך נאָר פֿאַר פּרעמיום־מיטגלידערRashi
This was unknown. These wars and the art of battle. It was unnecessary.