“Joshua fit the battle of Jericho and the walls come a-tumblin’ down.” Then he and his people sinned. The next part of the story didn’t go as well for them. Joshua decided to attack the small town of Ai next. They chased his warriors out of town and killed some of them. What happened?
Most obviously, someone named Achan took some of the spoils and hid them in his tent. God didn’t appear to Joshua and tell him what had happened and what he thought about it. He hardly ever does.