For it was of Yahweh to harden their hearts, to come against Israel in battle, that he might utterly destroy them, that they might have no favor, but that he might destroy them, as Yahweh commanded Moses.
The words of God to Moses to which the writer alluded (Joshua 11:23) are probably those in Exodus 23:27-33 (cf. Deuteronomy 7:22). There God told Moses He would not drive all the Canaanites out of the land in one year but little by little. This is how the conquest of the land had advanced thus far and how it should have continued to its completion.