Deuteronomy 7 may initially seem harsh, but it is crucial to examine the passage carefully. For instance, if the words “destroy utterly” (v. 2) actually mean to “wipe out” or “kill completely,” why would it be necessary to say that Israel should not intermarry with the Canaanites (v. 3)? That implies that there were people to marry still! In addition, as Moses continues, he makes clear that the destruction the people were to effect was in reference to the altars and high places, not the people themselves (v. 5). God did not want anyone to die, if at all possible, but He wanted people to return to true worship of Him. If the Baal and Asherah cults were still around, that would mean that people would be sacrificing their children and having sex with the temple priestesses. These actions were an abomination to God but would have been very attractive to Israel, as the Canaanites believed these rites were supposed to bring fertility to the land.
Driving out is not equal to wiping out. Deuteronomy is clear that Israel inherited cities that they did not build, houses and farms that they did not build or plant, wells they did not dig (Deut. 6), and so on. If this had been a massive conquest, all the cities would have been destroyed. As it is, there is archaeological evidence for the destruction of only three cities, which are the ones the Bible tells us were burned: Jericho, Ai, and Hazor. In all other cities, there is basically no evidence of change in occupation, so much so that many scholars do not believe the conquest happened at all. However, when we look at the biblical evidence, Joshua tells us that the Canaanites were afraid and fled, which would leave cities open to habitation by Israel, and they would not have to build or conquer much of anything. Some of the Canaanites also were willing to make peace or treaties with Israel (Gibeonites), and many others became Israelites themselves, converting to the worship of Yahweh (Rahab and Uriah among others).
In Exodus 23, God tells the people that it is His plan to do any work of killing, and that He will drive out the Canaanites ahead of Israel. Indeed, when Israel had faith, God did everything for them, because He knows hearts and when people are totally given over to evil. We see this especially in, for example, the Exodus event, the story of Jericho, God’s triumph through Gideon, 2 Chronicles 20, and the decimation of Sennacherib’s army. And God does not give land only to Israel. He recues other nations as well and gives them land, seen, for example, with Edom (Obadiah), and in Amos 9:7. Thus, when land is taken away, and people are destroyed, God treats everyone equally. He would have driven Israel into exile with minimal loss of life as well, but they were not willing to listen to Jeremiah and surrender.