I would dispute the statement that China has "done really well" under the pandemic, and that they've had "far lower deaths" than the US and Europe. You simply can not trust the numbers that come out of China regarding this, and logic points to their actual covid statistics being far, far higher than what they claim (they were the first ones hit, they have a massive population that lives in close vicinity in many places, they have had a panicked response to covid which would not be neccessary if things were going well, they are still having problems while the rest of the world is starting to move on, their vaccines are less effective than those of other nations, etc).
Regarding your actual question, the best explanation I have come across comes from the laowhy86 youtube channel regarding the zero covid lockdown policy that's currently in effect in Shanghai. The guy lived in China for ten years, speaks Chinese and is up to date with what is going on there (it's his livelyhood to be informed):
*The CCP are very reluctant to admit that they might have been wrong in their overall strategy, and thus will continue pursuing it no matter the cost (to save face)
*Regarding Shanghai specifically, Xi Jinping might be using the lockdowns as a means to punish political rivals which have a power base in Shanghai
*More speculative, but the CCP might be using lockdowns and such as a sort of "test run" for how they would fare under war time conditions