Worth noting the difference in scale between Russia (1.3m active personnel) and Ukraine (0.2m active personnel), the West are not directly participating in the battlefields (due to nuclear threats), and that Russia is connected to Ukraine by land.
For the Chinese case, the US has been very clear about sending armies to defend Taiwan, which is separated from China by sea.
So a technological gap can be a sufficient deterrent for the Chinese case, while less so for the Russian case.