The battle being fought by Russia and Ukraine is - for Ukrainians - existential. If they lose, their country may be gone, they will have to learn Russian, and become Russia's stigmatized second (or third) class citizens for several decades or emigrate and be not-very-welcome expats in Western Europe.
For Russia the battle is optional. If Russians leave and go home without winning they face no such shortfalls. It may turn their dreams of renewed empire somewhat sour, but that's about all.
All the Ukrainians have to do to eventually win is simply "not lose," not quit. They don't have to conquer Russia, something Hitler and Napoleon failed to do. They merely have to keep being a thorn in the occupying Russian's side, keep killing the odd, wandering Russian soldier, sabotaging the unwatched Russian vehicle or supply depot.
If Afghanistan is any indication, eventually Russians get tired of being a target, a punching bag, and go home.