“And Yahweh gave them into the hand of Israel.” Ultimately, Yahweh gives the victory. To really understand this, we must remember that the world is a spiritual place, not just a physical one. Satan and his demons are invested in certain results, and work behind the scenes to bring those results to pass. The Bible makes the point that “the race is not to the swift, nor is the battle to the strong” (Ecc. 9:11), sometimes by chance but sometimes because of the invisible spiritual forces are at play. When Israel obeyed God, and He could fight for them, He said, “Five of you will chase 100, and 100 of you will chase 10,000; and your enemies will fall before you by the sword” (Lev. 26:8; cp. Deut. 28:7; 32:30). But when Israel disobeyed God, then He could not intervene and things went terribly for Israel: “Yahweh will cause you to be struck before your enemies; you will go out one way against them and will flee seven ways before them” (Deut. 28:25). The earth is a war zone between good and evil, between God and the Devil, and the way humans behave often determines which spiritual side has the upper hand in any given conflict (see commentary on Luke 4:6). We can see the effects of both obedience and disobedience in the wars of Joshua. When Israel obeyed God, miraculous victories, like the victory at Jericho, happened. When Israel disobeyed God, stunning defeats, like the defeat at Ai in Joshua 7 occurred. Although the Bible has many examples when things did not go well for individuals who obeyed God—Job and Jeremiah are two good examples—generally things go much better when people obey God.
“as far as great Sidon.” Sidon was on the border of the tribe of Asher (Josh. 19:29), but the Israelites were never able to conquer and hold the Phoenician coast.