What does Deuteronomy 7:1-4 mean?

1 When the LORD thy God shall bring thee into the land whither thou goest to possess it, and hath cast out many nations before thee, the Hittites, and the Girgashites, and the Amorites, and the Canaanites, and the Perizzites, and the Hivites, and the Jebusites, seven nations greater and mightier than thou; 2 And when the LORD thy God shall deliver them before thee; thou shalt smite them, and utterly destroy them; thou shalt make no covenant with them, nor shew mercy unto them: 3 Neither shalt thou make marriages with them; thy daughter thou shalt not give unto his son, nor his daughter shalt thou take unto thy son. 4 For they will turn away thy son from following me, that they may serve other gods: so will the anger of the LORD be kindled against you, and destroy thee suddenly. (Deuteronomy 7:1-4 KJV)

Thomas Scott

Verses 1-4. The number and names of these nations here vary from those which had been before mentioned. ( Note, Ge 15:18-21.) In a long course of years many revolutions would take place; some tribes would be extinct, or incorporated with others, and some would have changed their names. But they were the posterity of the same people, inhabiting the same land, and they had now filled up the measure of their iniquities. Israel was therefore commissioned to execute of divine vengeance; and they were not only justified in all they did, but they actually offended, and were themselves chastened, for not more entirely extirpating them. Yet they would by no means have been justified, if they had, from love of conquest and thirst of dominion, carried on such bloody wars against any nation not expressly included in their commission; their conduct therefore can form no precedent to others, nor in the least excuse the murder and rapine which mad ambition hath in all ages been committing.—The Lord was pleased, in this solemn transaction, not only to show his abhorrence of sin, but, by thus executing vengeance upon guilty nations, to teach all, who regard the scriptures, the real cause of the heavy calamities with which, in the ordinary course of his providence, he punishes one kingdom after another.