I have no doubt that the Chinese people are civilized and law abiding. But that is the case in other countries as well. So what made the difference here?
The advantage with China is that it is an authoritarian country, with no room for personal liberty or human rights. So obviously when the government announced a complete lockdown, the people had no choice other than to comply with it. Those who refused to follow the order were arrested and quarantined. Now this is something that can't be implemented in democratic nations. In US, Australia.etc, you can find a lot of people who are roaming in the streets even in places where lockdown is announced. And in the US, people are protesting against the requirement to wear masks.