Deuteronomy 9:4-6
4Don’t say in your heart, after the LORD your God has thrust them out from before you, “For my righteousness the LORD has brought me in to possess this land;” because the LORD drives them out before you because of the wickedness of these nations.b
5Not for your righteousness or for the uprightness of your heart do you go in to possess their land; but for the wickedness of these nations the LORD your God does drive them out from before you, and that he may establish the word which the LORD swore to your fathers, to Abraham, to Isaac, and to Jacob.
6Know therefore that the LORD your God doesn’t give you this good land to possess for your righteousness, for you are a stiff-necked people.