[[Israel]]'s conquest of the mighty city of Jericho, covered in chapter 6, is an illustration of several practical spiritual truths. [[God]]'s only requirement of the [[Israel]]ites was that they wait, obey, and trust Him for the [[victory]].
Chapter 7 records the disobedience of Achan. [[God]] told Joshua that the spoils of Jericho were consecrated to Him and were to be placed in His treasury. But Achan disobeyed [[God]]'s instructions. He thought he could hide his [[sin]]. And because an "accursed thing" was in the camp, [[God]] could not dwell with His people. This caused their defeat at Ai. Achan's disobedience was discovered and exposed.
Now that the nation has been sanctified and Achan's [[sin]] judged, [[God]] can again lead His people to [[victory]]. Chapter 8 covers the destruction of Ai. The first defeat was used to good advantage, for now the people of Ai were confident they could overcome [[Israel]] again. Note also in this chapter that [[God]] allowed the people to take the cattle and the spoil from Ai. If Achan had only waited a few days he would have had all the wealth he could have carried!