After reminding the Children of Israel of the covenant He made with the patriarchs, God promised to send an angel ahead of the Jews to drive out the seven nations from the land:
I will send an angel before you, and I will drive out the Canaanites, the Amorites, the Hittites, the Perizzites, the Hivites, and the Jebusites Exodus 33:2
It is interesting to note that God adds that had the Hebrews not sinned with the Golden Calf, He would have led the battle himself.
The list of the Canaanite nations is repeated but slightly different in Deuteronomy:
When Hashem your God brings you to the land that you are about to enter and possess, and He dislodges many nations before you—the Hittites, Girgashites, Amorites, Canaanites, Perizzites, Hivites, and Jebusites, seven nations much larger than you. Deuteronomy 7:1
In fact, the nations of Canaan are enumerated in Tanakh (Bible, i.e. Torah, Prophets, Writings) twenty-three times, mostly in the Torah and in Joshua. Only three of these lists actually include all seven nations – twice in Joshua (3:10 and 24:11) and only once in the Torah. The list of nations appears seven times in Exodus, all of which omit the Girgashites. In one list, the Perizzites are omitted as well, and in another only three nations are listed. Commentators suggest the text in Exodus 33 hinted at the Girgashite with the Hebrew word for ‘drive out’ which is gayrashti (גֵרַשְׁתִּי).
One notable exception to the imperative to drive out the nations of Canaan was Rahab who hid the spies in Jericho. She and her father’s family dwelled among the Jews (Joshua 6:25). According to the Midrash, Rahab converted and married Joshua.
Another notable exception were the Hivite Gibeonites who tricked Joshua into making a pact with them by convincing him they came from afar (Joshua 9).
It should be emphasized that the imperative to kill the seven nations applies only within the borders of Israel. Should they leave the land, there is no need to pursue them in order to fulfill this commandment. This stands in contrast to the Biblical commandment to wipe out the nation of Amalek which applies to all places and all times.
At face value, it may seem that eliminating the nations who were dwelling in the land was a practical measure necessary for taking possession of the land, but the Jews were forbidden from making peace with these nations which would have also been an effective method of living in the land. In Deuteronomy, different reasons are given for eliminating these nations; lest the Jews intermarry with them and thus be lead to idolatry.
This was a difficult commandment, as the Children of Israel were a returning indigenous people and therefore related to the nations they were commanded to drive out. This was emphasized by the Prophet Ezekiel:
Thus said Hashem to Yerushalayim: By origin and birth you are from the land of the Canaanites—your father was an Amorite and your mother a Hittite. Ezekiel 16:3
The prohibition against intermarriage extends to marrying anyone who is not from the nation of Israel, whether in the land or in the exile, whether from the seven nations or any other nation, as expressed by Nehemiah:
Also at that time, I saw that Yehudim had married Ashdodite, Ammonite, and Moabite women…How, then, can we acquiesce in your doing this great wrong, breaking faith with our God by marrying foreign women?” Nehemiah 13:23,27
Today, Israel still faces the threat of intermarriage and assimilation. In the exile, the Jews intermarried and adopted other faiths resulting in what some scholars call a “silent Holocaust.” Even in Israel where, despite the majority Jewish population, missionizing and intermarriage are on the rise and have a detrimental effect on the spiritual condition of the Jews. Biblical Israel was not ethnically cleansed of all but the Jews, and ger toshav (resident alien) was a respected status. But these non-Jewish residents were absolutely forbidden from practicing any form of idolatry. The land of Israel is not simply the property of the nation. The land of Israel is the physical manifestation of God’s covenant with Israel and, as such, had to remain pure and free of idolatry.