Consider it a warning: the Israelites were told not once, but three times in just a few minutes that they hadn’t done anything to win God’s favour:
Deuteronomy 9:4 After the Lord your God has done this for you, don’t say in your hearts, ‘The Lord has given us this land because we are such good people!’ No, it is because of the wickedness of the other nations that he is pushing them out of your way.
No, it was because the current occupants were so wicked.
Then Moses says it again:
Deuteronomy 9: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.
Deuteronomy 9:6 You must recognize that the Lord your God is not giving you this good land because you are good, for you are not—you are a stubborn people.