Joshua 10:17

And it was told Joshua, saying, The five kings are found hid in a cave at Makkedah.

The hiding of the five kings in the cave at Makkedah belongs to the larger history that begins with the Gibeonites deceiving Israel to obtain a treaty. That deception and the resulting league in Joshua 9 leads directly onward into the warfare and pursuit described in Joshua 10. The report of the kings found at Makkedah is thus one incident within that continuous account of covenant followed by battle.