Achan's sin and the defeat at Ai
Israel was routed at the small town of Ai because Achan had secretly kept plunder from Jericho; after he was exposed and judged, Ai was taken by ambush.
But the children of Israel committed a trespass in the devoted things; for Achan, the son of Carmi, the son of Zabdi, the son of Zerah, of the tribe of Judah, took some of the devoted things. Therefore Yahweh’s anger burned against the children of Israel.
Joshua 7:1 (World English Bible)
Achan hid a fine robe, silver, and a bar of gold under his tent. The whole nation suffered for one man's hidden sin until it was dealt with. The second attack on Ai succeeded with an ambush, following God's instructions.
Places
BethelJerichoAiArabahValley of AchorBeth-avenShebarim
Dating notes
Ussher, 1451 BC. The location of Ai is debated (et-Tell or Khirbet el-Maqatir).