Joshua clearly learned his lesson in the treaty with Gibeon because he apparently seeks the Lord before marching into this battle. The Lord assures Joshua they should not be afraid because God has determined that this gang of five armies will be defeated. God will give them into Joshua's hand Josh 10:8.
The army of Israel marches all night and takes the 5 armies by surprise. I am sure that humanly speaking Joshua was looking for an advantage in battle. He was surely outnumbered. I don't think it would have mattered when he attacked, God was doing battle for the nation of Israel so their victory was secured. God intervened in a miraculous way. He threw the opposing armies into confusion. Josh 10:10; God sent hail as they fled Josh 10:11, and at Joshua's request God made the sun and the moon stand still for a day as Joshua defeated the enemy.
Later in the chapter after defeating the armies, the Kings are killed and each of the Cities is invaded by Israel and utterly destroyed.
When enemies attack God's people they stand against God himself. Just as the Gibeonites received support from Israel, Israel drew its strength from the Lord. When we are in the midst of conflict, we too can know that we serve a God who is able to stop the world from spinning if it will bring Him glory and demonstrate His power.
While God gave the victory and the cities were defeated, the Israelites were not passive viewers of the battle, they were active participants in it. When they invaded the five cities, they left no survivors. The bloodshed must have been horrific, but Israel was obedient to God and left no trace of Amorite influence to poison their people. As people of God we are not exempt from battle and conflict, but as we trust in God for our strength and are obedient to His calling in our lives, He is faithful in protecting and caring for His people.
Dear Christian, you are a child of God by adoption through the substitutionary death of Jesus which purchased our redemption. As His children, God will not abandon His own to the enemies you face. He will also not exempt us from the conflict. In obedience our faith is stretched and strengthened as we learn to depend on Him for each and every victory.
We are no longer our own and we no longer belong to the devil, we belong to Jesus Christ, we are His church; we are His Bride. We are not merely left to our own devices as we go into battle. We are challenged each and every day to put on the full armor of God and be prepared for the conflict. Far too often we fail to prepare and feel defeated. We have great power we can depend on as we witness to the world of God's offer of redemption for them. Though we may be rejected and even ridiculed, God protects his own and builds an even greater testimony for Himself.
Prepare yourself for battle today and be faithful to serve the Lord in thought, word and deed today.
May God richly bless you as you seek Him and as you serve Him.