Under the Mosaic covenant, there were specific promises made by the Lord with regard to battle. If Israel was obedient to the Lord, they could expect their enemies to flee before them (Deuteronomy 28:1–2, Deuteronomy 28:7). If, however, they were disobedient, then they could expect to flee before their enemies (Deuteronomy 28:15, Deuteronomy 28:25).
12 Therefore the people of Israel cannot stand before their enemies. They turn their backs before their enemies, because they have become devoted for destruction. I will be with you no more, unless you destroy the devoted things from among you.