It was only in order that the generations of Bnei-Yisrael might learn from war, which they had not experienced before.