Read Deuteronomy 20 – Rules of war – If I were in charge of a war (it’s not likely) I would want every conceivable person on my side. I would want a large army to show up and stand with me. But God’s ways are not my ways, and God only wants those pure in heart in the battle.
The first thing God commands is, “You shall not be afraid, for the LORD your God is with you, who brought you up out of Egypt.” (:1-4) Being reminded of who God is, what he has done, and that he is with you is a great strength when facing any battle. Then the officers were to thin out the soldiers by calling out those who needed to settle things at home or were just plain fearful. (:5-8) The LORD can do great things with pure hearts and those men would be hindered by the half-hearted.
The first act in an impending battle was to offer peace. (:10) If peace were acceptable, the townspeople would serve the Israelites and do the forced labor. If they did not accept peace, the Israelites were to siege the town, putting all males to the sword. (:12-13) It is generally understood that any surviving male would be a perpetual enemy. The women, children, livestock and spoils were considered plunder… spoils to be enjoyed by the fighting men of Israel.
BUT, certain cities that the LORD was giving Israel required everything that breathed be killed. These places were so wicked that their utter destruction was required, so that their sin would not corrupt Israel. However, the LORD had special instruction for the trees. Fruit bearing trees were not to be cut down and the men could eat the fruit. Other trees could be cut and used to build siege works until the city fell.
Beloved, marvel at these details, nothing escapes the LORD’s instruction. May your heart be pure and useful to the LORD in all ways.