There have been times, after a long losing battle with sin, when I've glimpsed the answer: humility. When I "succeed" in my obedience (there's a telling phrase!) I get smug and proud. When I fail, over and over again, it humbles me. I need this, because I'm all too ready to think I can get it right!
Here's another, even better answer. I came across it the other day while preparing a Bible study on Romans. It's by David Seccombe:
Over and over again we are disappointed by our own performance. We pledge our day to God in the morning, pray for grace to overcome all trials, and in the evening look back with shame at nasty words and thoughts, greed, pride, cowardice and so on...We may venture the thought that, if God has withheld the grace of instant sanctification, desperately as most Christian would love to have it, it is because there is a greater gain to be had in the lifetime of struggle with evil to which he commits us...The daily reality of sin causes us again and again to look to our Saviour for forgiveness, and to rest our trust in him that we stand accepted by God ever and only because of his gift.So why does God let me go on struggling with sin? Here's the answer: grace. I didn't just become a Christian by grace; I live in it every day. When I fail, then fail again, it becomes obvious even to me that I can't depend on my own efforts. I'm driven back to the Saviour. That's what sin does. It drives me away from self-assurance and to the foot of the cross.
(There's an even bigger answer: God's glory, and the glory of his Son - Rom 9:22-24, 1 Cor 15:20-28, Eph 1:3-14 cf. Exod 9:16. But that's a post for another day.)
Quote is from David Seccombe Dust to destiny: Reading Romans today 124-127.
image is by Keoni Cabral from flickr