God assured Moses of Israel's vistory throughout Canaan (if they obeyed Him).
As GOD concluded His initial message to Moses at Mount Sinai, after having spoken the Ten Commandments to all of Israel, GOD told Moses:
23 For My Angel will go before you and bring you in to the Amorites, the Hittites, the Perizzites, the Canaanites, the Gergesites, the Hivites, and the Jebusites; and I will cut them off. 24 You shall not bow down to their gods, nor serve them, nor do according to their works; but you shall utterly overthrow them and completely break down their sacred pillars. 25 So you shall serve the Lord your God, and He will bless your bread, wine, and water; and I will take away sickness from you. 26 No one shall suffer miscarriage or be barren in your land; I will fulfill the number of your days.
27 “I will send My fear before you; and I will cause confusion among all the nations to whom you come, and will make all your enemies turn their backs to you. 28 I will also send hornets before you which shall drive out the Amorites, the Hivites, the Canaanites, and the Hittites from before you. 29 I will not drive them out from before you in one year, lest the land become desolate and the wild animals of the field become too numerous for you. 30 Little by little I will drive them out from before you, until you have increased and inherit the land. 31 And I will set your bounds from the Red Sea to the sea of the Philistines, and from the desert to the Euphrates River. For I will deliver the inhabitants of the land into your hand and will drive them out from before you. 32 You shall make no covenant with them, nor with their gods. 33 They shall not dwell in your land, lest they make you sin against Me. For if you serve their gods, it will surely be a stumbling block to you.”
(Exodus 23:23-33 OSB)
All Israel had to do was live faithfully to GOD and He would fight their battles for them to ensure their victory.