King Adoni-zedek of Jerusalem hears about the sieges of Jericho and Ai, as well as the treaty of Gibeon, and becomes incredibly frightened.
He calls the kings of Hebron, Jarmuth, Lachish, and Eglon to make war against Gibeon and get back at them for making peace with Joshua. The kings agree and everyone sets up their war camps. We're thinking there wasn't too much s'more making around those campfires.
The Gibeonites send word to Joshua that they are going to be attacked, and Joshua and his army ride through the night to help out because, in case you hadn't noticed, they're pretty hardcore.
The opposing army panics at the sight of the Israelites, and flees into a hailstorm that kills most of them. Seems like dying was on the agenda no matter what that day.
The text backtracks for a moment to let us know that the reason God was so on top of things for this fight was because Joshua got in touch and was all like, Hey, God—help an army out. And God listened, which is a pretty big deal since Joshua's just a lowly human.