Numbers 31 gives some backstory for the events that occurred earlier in the book of Numbers. God commands Israel in chapter 31 to attack and defeat the Midianites. In addition to the Midianite kings, one other person is killed by Israel: Balaam, son of Beor (Numbers 31:8). In Numbers 22-24 the Midianite King Balak summoned Balaam to curse Israel, but Balaam refused, knowing that YHWH blessed Israel and would not curse them. So why does Israel put Balaam to the sword? Balaam knew YHWH would not curse Israel, but he thought of a way that Israel might bring a curse upon themselves. We find out he was the one who encouraged Midianite women to entice Israelite men into adultery and idolatry (Numbers 31:15-17). Balaam incited the sin that led to the plague when Phinehas son of Eleazar killed the Israelite man and the Moabite woman. This helps to clarify that these women knowingly deceived Israel’s men so that YHWH might destroy them. These women are not innocent bystanders; in this battle, they destroyed Israel far more effectively than Midianite swords.
In the future, the Israelites will destroy other Canaanite cities. Though the Canaanites might appear innocent, it is important to remember that we might not always have all the details from the God who loathes evil and calls for its destruction. When we keep this in mind, we are better positioned to understand the Israelite conquests of foreign nations, which many view among the most troubling aspects of the entire Bible.