“It was only in order that the generations of the people of Israel might know war, to teach war to those who had not known it before” (v2). Joshua led a generation of warriors and conquered enemies, but when they died, the next generation did not have the same faith. God let them struggle against their enemies so that they would learn to depend on Him in battle (v1), as their ancestors did, looking to Him for guidance and victory. God wanted them to understand that only He could make them secure.
“So the land had rest forty years” (v11). We find the “rest” (peace and security) we need by surrendering totally to the Lord. He wants to fight for us.