The discovery of the enemy kings marks a sudden turning point in the heat of the pursuit. Up until the moment they were found, the Israelite soldiers had been actively and intensely searching the battlefield, unable to locate them [מלבי״ם].
When the messengers brought the news to Joshua, their report carried a deeper layer of wisdom. They hinted that because the spiritual forces of these kings had already been defeated in the heavens, it was inevitable that they would be found on earth. No clever trick or hidden refuge could possibly save them from facing justice [חומת אנך].
Furthermore, the message was delivered to Joshua with a highly practical purpose. Because the Israelite warriors were still running back and forth in a frantic search, Joshua needed to publicly announce the discovery. Broadcasting this news would immediately spare the soldiers from wasting any further time and exhausting effort on a hunt that was already over [חומת אנך]. Ultimately, the kings' chosen hiding spot was a specific cave situated directly within the borders of the city of Makkedah [רד״ק].