…you shall strike them and you shall utterly destroy them… (Deuteronomy 7:2)
To modern sensibilities, this mitzvah is one of the hardest to understand. It completely flies in the face of everything we think we understand about God and Torah. In fact, it reminds us very much of things we criticize about others! How is it different and how can we understand why God would want us to do this?
Despite common misunderstandings of this and related mitzvos, we don’t have blanket campaigns to eradicate or convert individuals of other faiths. And when we do have an obligation to kill, collateral damage in the form of civilian casualties is not an acceptable by-product. But there are certain things that we are commanded to eradicate.
There were seven Canaanite nations that occupied the land of Israel when the Jews left Egypt. There were three ways these nations could proceed: (1) they could leave; (2) they could agree to adhere to the seven universal (Noachide) laws and submit to Jewish rule; or (3) they could fight. We didn’t necessarily have to wipe them all out with a sword but one way or another, these nations had to be dismantled. (What we weren’t allowed to do was to offer them a peace treaty. Nevertheless, when Joshua was tricked into signing a treaty with the Gibeonites, who pretended to be from a faraway land and not Canaanites, he felt obligated to honor the treaty despite the subterfuge. See Joshua chapter 9.)
The reason underlying this mitzvah is that these nations were thoroughly immersed in idolatry. Idolatry is anathema to God, it’s spiritual poison for the Holy Land, and to permit it to continue would be like laying a trap for the nation. Therefore, the seven Canaanite peoples had to be removed by any means necessary.
This mitzvah applies in all times and places. It is discussed in the Midrash in the Sifre. It is codified in the Mishneh Torah in the fifth chapter of Hilchos Melachim. This mitzvah is #187 of the 248 positive mitzvos in the Rambam’s Sefer HaMitzvos. It is not listed in the Sefer HaMitzvos HaKatzar of the Chofetz Chaim.