In Exodus 23:27 God tells Moses that he will defeat every enemy he encounters:
I will send my terror ahead of you and throw into confusion every nation you encounter. I will make all your enemies turn their backs and run. (NIV)
However, history indicates many defeats suffered by the Israelites. Note that most believers will pull logical fallacy and claim that the defeats happened only at times when the Israelites weren’t pious enough.