The book of Numbers deals with Israel's years in the desert. As we begin this book, the Israelites have been free from Egypt for just over a year, for the first verse tells us, "The Lord spoke to Moses in the tent of meeting in the Desert of Sinai on the first day of the second month of the second year after the Israelites came out of Egypt." (Numbers 1:1)
We find Moses communing with the Lord in the sanctuary as Numbers begins. I believe Moses spent a lot of time in prayer with the Lord. He had to in order to receive the Lord's guidance in leading the people. While Moses is engaged in prayer with the Lord, the Lord tells him to take a census of the people. "He said: 'Take a census of the whole Israelite community by their clans and families, listing every man by name, one by one. You and Aaron are to count according to their divisions all the men of Israel who are twenty years old or more and able to serve in the army." (Numbers 1:2-3)
The main purpose of this census is to form an army, which they will need when taking over the promised land from the idolatrous tribes the Lord plans to uproot from Canaan. Although it's the Lord's will for the Israelites to occupy this territory, He isn't going to supernaturally remove the pagan people from the land so the people of Israel can move right in. This endeavor is going to involve the Lord and Israel fighting side by side.
There are times in our lives when the Lord clears up our unpleasant circumstances all on His own. Then there are other times when He calls upon us to get in the trenches with Him and fight the battle together. He chooses whichever method is best for our spiritual development. In the case of Israel taking over the promised land, it was better for the spiritual development of her citizens to fight alongside the Lord for the land that the Lord promised Abraham long ago. If the Lord had just supernaturally handed over the promised land to them, would the land have felt as much "theirs"? If they had to put no effort into taking this territory, would their hearts have been fixed on this land to defend and protect it at any cost for themselves and for the generations to come? When we put effort of our own toward a specific purpose, the achievement of that purpose means so much more to us. The victory is so much sweeter. And our relationship with the Lord grows because in the heat of battle we feel the awesome comfort of His presence beside us.
I'll provide an example of just a couple of situations in which the Lord fought the battle for me on His own. Twice so far in my life I've had unusual, mysterious, and very painful illnesses. The first time it happened I was 28; the second time I was 48. (It was not the same type of illness both times. They were completely different.) There was nothing I could do either time to make myself feel better. I saw lots of doctors and endured lots of tests. I fell into depression and had panic attacks wondering whether I'd ever be okay again and how I was going to manage to live with so much pain. In both these cases the Lord healed me. I can look back now and see some reasons why He let me go through what I went through, but in both these cases He fought the battle for me. I couldn't fix what was wrong with me. The doctors weren't sure what was wrong with me or how to fix it either. The Lord fought the battle alone and did what needed to be done to turn my circumstances around. I didn't have the physical strength or the scientific knowledge to help myself. I wasn't doing too well with my spiritual strength either because the pain had really gotten me down. The Lord did all the work for me.
But there have been other circumstances in which the Lord expected the two of us to go out onto the battlefield together. This wasn't because He needed my help. The Lord can do everything that needs doing on His own; He never asks us to fight with Him because He can't win the battle by Himself. But He's asked me to fight alongside Him at times because I would benefit more spiritually by fighting side by side with Him. In these cases I needed to be heavily invested in the battle so I would be heavily invested in its outcome, the same way Israel had to be heavily invested in the battle for the promised land so she would be heavily invested in the outcome. Most of the time we don't grow very much spiritually when we aren't called upon to flex our spiritual muscles in the heat of battle. Just as we can't become physically fit without pushing ourselves to increase in strength and endurance, we can't grow spiritually if the living is always easy and we are never expected to participate in the things that lead to victory.
I think another reason the Lord expects the Israelites to fight in the battles to take over the promised land is because they need to develop the physical strength to defend themselves against their enemies. If the Israelites hadn't fought for the promised land, they wouldn't have had the military might to hold on to the promised land. Once they occupy the land, they are going to have to be able to protect and defend it. The Lord wouldn't be doing them any favors if He did all the work for them. They are going to be forming a nation and a nation needs an army. The Lord has already provided the laws and commandments necessary for forming a society and a government. Now He's going to begin preparing them to form a powerful military.