This was to teach the future generations of the Israelites how to fight in battle, especially those who had not fought before.