The book of Deuteronomy is written as a speech by Moses, delivered shortly before he dies and the Israelites cross over the Jordan and begin to conquer the Promised Land. Moses reminds the people of their journey to this point and recaps the Ten Commandments and the other laws that God has given them. In
chapter 7 Moses gives instructions for the conquest of the land. Unsurprisingly, given the fact that
last time the people were at this stage they were too afraid, Moses gives lots of encouragement. He reminds the people that God has
chosen them and that God
has done amazing things for them already. He promises a life of
fertility and riches.
It's made very clear to the Israelites though that there are to be no half measures. They are to
completely drive out the people who are in the land; they are not to
intermarry with them. Otherwise, says God, the people will be tempted to begin worshipping other gods. The promise of a land for God's people will be watered down and they'll become just another nation living among many and indistinguishable from them. This dishonours God: He has chosen this people and if they don't remember that they're different then they're ignoring His choice.
Many Christians use this model in their own lives. They set a boundary, a line that divides their ideas and behaviour from the thoughts and behaviour of the world. Depending on how they or their church or denomination interpret what the Bible says, this dividing line makes them more or less different from the world. Many Christians also use this approach when they are aware of areas of sin in their own lives; they want to change some aspect of themselves and decide that there must be no compromise with their old life. They must change completely. This is the point where it's useful to remember
verse 22.