5 It is not because you are so good or have such integrity that you are about to occupy their land. The Lord your God will drive these nations out ahead of you only because of their wickedness, and to fulfill the oath he swore to your ancestors Abraham, Isaac, and Jacob.

Matthew Henry's Commentary on Deuteronomy 9:5

Commentary on Deuteronomy 9:1-6

(Read Deuteronomy 9:1-6)

Moses represents the strength of the enemies they were now to encounter. This was to drive them to God, and engage their hope in him. He assures them of victory, by the presence of God with them. He cautions them not to have the least thought of their own righteousness, as if that procured this favour at God's hand. In Christ we have both righteousness and strength; in Him we must glory, not in ourselves, nor in any sufficiency of our own. It is for the wickedness of these nations that God drives them out. All whom God rejects, are rejected for their own wickedness; but none whom he accepts are accepted for their own righteousness. Thus boasting is for ever done away: see Ephesians 2:9,11,12.