Deuteronomy 9:4-7 AMP
“Do not say in your heart when the LORD your God has driven them out before you, ‘Because of my righteousness the LORD has brought me in to possess this land,’ but because of the wickedness of these nations the LORD is dispossessing them before you. It is not for your righteousness or for the uprightness of your heart that you are going to possess their land, but because of the wickedness of these nations the LORD your God is driving them out before you, and to confirm the oath which the LORD swore to your fathers, to Abraham, Isaac, and Jacob.
“Know [without any doubt], that the LORD your God is not giving you this good land to possess because of your righteousness, for you are a stiff-necked (stubborn, obstinate) people. Remember [with remorse] and do not forget how you provoked the LORD your God to wrath in the wilderness; from the day you left the land of Egypt until you arrived in this place, you have been rebellious against the LORD.