They received help in fighting these enemies because they called out to God during the battles. In this way they were able to defeat the Hagrites and all who were with them. God answered their prayers because they trusted in him.
just as Scripture predicted: “Look, I'm placing in Zion a stumbling-block, a rock that will offend people. But those who trust in him won't be disappointed.”