An excerpt from the first link:
"The Torah explicitly commands us regarding hostile populations that endanger Israel: “But if you do not drive out the inhabitants of the Land from before you, then those whom you leave over will be as spikes in your eyes and thorns in your sides, and they will harass you in the land in which you settle” (Bamidbar 33:55). The Torah further states, “And I will make your boundary from the Red Sea to the sea of the Philistines, and from the desert to the river, for I will deliver the inhabitants of the land into your hands, and you shall drive them out from before you” (Shemot 23:31)."