On paper, Russia had a better military than Ukraine, but "paper" doesn't account for intangible factors like "ability to plan and execute". Moreover, from my understanding, Russian generals or intelligence officials were kept out of the loop until a week or two before the invasion was launched--they planned for a military exercise. So it's possible that the Russian military is a lot more capable, but that Putin foolishly hamstrung it.