The Day the Sun stood still
And it says in the battle that followed;
"The Lord threw them into confusion before Israel. And it came to pass as they fled from before Israel, the Lord hurled the large hailstones down upon them from the sky ..."
So when Joshua & his men had done what they could, then the Lord intervened with huge hailstones to help them.
And yet still the five Kings with some of their men were able to flee from the battle.