In this chapter, Joshua leads his army to destroy Ai.
After their defeat against Ai, it is a military necessity that they fight against Ai and beat them, if for no other reason than to discourage the other Amorites who would have heard about the Israelites' defeat. A victory over Ai now would reverse most of the negative consequences I mentioned in the prior chapter.
That said, this battle couldn't be more different from the fight against Jericho. The fight against Jericho was wholly supernatural, where the nation simply walked and shouted and the walls of the city fell down. In this case, the LORD is still commanding Israel, but instead directs them to use subterfuge, which is fairly common as far as ancient warfare goes (although probably less common than conventional fighting and starvation). The LORD has them play upon Ai's overconfidence from their earlier victory to draw them out of the city and then attack from two directions. They also bring 30,000 men this time, which is still far less than the 600,000 armed men they have, but 10 times what they brought the prior day.
If you remember from two chapters ago I was talking about how important city walls are to siege warfare because the defenders are outnumbered many times. The walls in effect give them a force multiplier that lets them hold out against a superior force. With all the defenders pulled away from the city walls (which are then captured by the second Israelite force) the men of Ai have a very small chance of success on the field.
As before, the Israelite slew all the women and children as well, because in wars of conquest there are no civilians. See my introduction to Joshua for more on this topic.
Joshua also kills the king of Ai and hangs his body until sunset, when it is taken down. This is in accordance with the command in Deut 21:23 not to leave a body hanging overnight.
Most importantly, the Israelites fought under the guidance of the LORD this time, which ensured their success. Another key difference between Ai and Jericho is that against Ai, the people were permitted to plunder the animals and gold. They will be permitted to plunder the other cities of Canaan as well; only Jericho was reserved wholly for the LORD. But I think it's really interesting to contrast the fight for Ai with the fight for Jericho, because I think it really demonstrates the multivarious ways that the LORD will lead people. I couldn't tell you why, but the LORD simply doesn't do the same thing over and over. He changes his methods and means even when the ends are similar. Just as the LORD destroys one city with fire (Sodom) and destroys the world with water (the great flood of Gen 7), so the LORD destroys Jericho with a great shout and Ai with clever tactics on the battlefield. In the same way, the LORD will save different people in different ways. For one, it might be years of debate and philosophy, convincing the mind and then moving the heart. For another, it could be a miraculous encounter on the road to Damascus (Acts 9), or even an earthquake and a near scrape with suicide (Acts 16). Many of these differences can be attributed to the dictates of circumstances, but I think there is an additional factor, which is the creativity of God. God is a creator, and it is fitting that he should create not just when he makes new life, but also when he brings change to the world, doing "a new thing" and bringing renewal. In this case, the LORD is also doing something new in how he leads Israel to destroy their enemies.
Lastly, this chapter ends with Joshua and the people recite the blessings and curses of the covenant that were listed in Deut 27 and 28. Deut 27 also has a command to carve the words of the law on stones set up, which Joshua also does in this chapter. Everything in this final section seems to correspond with what Moses commanded in Deut 27. This is the last time Mount Ebal and Mount Gerizim are mentioned in the bible, so it does not seem likely that Israel ever repeated this ritual.