The two are interconnected. Ukraine's success costs Russia more in ammunition, oil, and manpower. Russia has a horrendous attrition rate of ~30,000 killed/injured per month. Ukraine manufactures 70% of its own munitions and uses drone swarms to attack Russian logistics and Crimea, taking land back.
Ukraine is squeezing Crimea, which is a large Russian base.