They cried out to God during the battle, and he answered their prayer because they trusted in him. So the Hagrites and all their allies were defeated.