Russia, which has done this kind of thing many times before, as has China, was hoping that Ukraie would be forced by the West into peace talks that would end with a partition of Ukraine. That would leave Russia with most of what they've taken and a militarised border they could fortify and build up troops along for a few years before pushing back in and taking the rest. That strategy worked in Viet Nam, but has failed, so far, in Korea.
Clearly, the Ukrainians are not prepared to engage in peace talks until every Russian soldier is gone from Ukrainian (and probably Crimean) soil. The war has gone on longer than it needed to because the West is still scared of nuclear retaliation and as such has failed to put boots on the ground in Ukraine or to make Ukraine part of NATO.
Ukraine is punching above its weight due to the dedication of its' fighters, the steady inflow of munitions from the West and a number of unofficial 'advisors' in the shape of US and UK veterans who have quietly slipped in since it all started.