All is by grace
"When the LORD your God drives them out before you, do not say in your heart, 'It is because of my righteousness that the LORD is bringing me into possession of this land. For it is because of the wickedness of these nations that the LORD drives them out before you." (Deuteronomy 9:4)
In Deuteronomy 9:4, the Lord tells his people not to think that he is driving out the nations before him because of their righteousness. Rather, he says it's because of the wickedness of those nations. This is a grace that the Lord gives to his people - that he drives out the wicked so that his people can inherit the land. It's a powerful act of grace that we see repeated throughout Scripture. And it's a grace we, too, can receive from the LORD.
When we are beset on all sides by wickedness, when we feel as if we are being driven out by circumstances beyond our control, we can take comfort in knowing that the Lord will drive out our enemies and give us rest. We can receive his grace and find strength in him.
In what way do we deserve what we have, given that we have everything by grace. And the Lord gives us grace of all things, according to his good pleasure, in fulfillment of his promises. And our victories are due to the punishment of our enemies, who de facto are also the Lord's enemies. That's what we should remember about this passage.
It was by grace that God adopted us as his children. If we have become his children, God promises to drive out the children of Anak, i.e. all obstacles, before us. If you like, they symbolize our enemies and adversaries, overt and covert. Our enemies are those who seek to harm our lives. Our adversaries are those who are in competition with us (esoteric religions, for example, stand side by side with the anti-Christs). We are aware of their strength and power. They are formidable, but the Lord asks us not to fear them, for they will be defeated. He himself will fight them. He will do it for us, and that is a grace. He will do it according to his love and faithfulness. His promise is fulfilled in faith and hope. (John 11:40)
He identified us as a stiff-necked people. "Know therefore that not for thy righteousness doth the Lord thy God give thee this good land to possess it; for thou art a stiff-necked people." (Deuteronomy 9:6) "Not by works, lest any man should boast." (Ephesians 2:9) But by grace. This invites us to trust, but first to be humble.
P. Clémentine