Because it has, for now. Other provinces were put under almost total lock-down soon after Wuhan was quarantined. The place where I live is over 1000 km from Wuhan, but everybody has been pretty much confined to their own homes for the past 6 weeks. Only one person per household was allowed to leave their residential complex once every 2 days, although pretty much everyone I know just made a big shop once a week. The daily number of newly confirmed cases still rose for about two weeks, and then gradually became fewer and fewer. The city where I am has now gone 3 weeks with zero newly confirmed infections. Things are just beginning to relax where I am (shops reopening etc), although the amount of traffic and people in the shops is still much less than usual.
I was quite happy and optimistic about the whole thing, until I started looking at predictions from some western experts about how the virus will just come back again. People here took the first quarantine period with patience and understanding, but a second round would be really disappointing. Those doctor/nurses unmasking videos have a slight hint of Bush's "mission accomplished" banner to them right now.
Whatever one thinks of the Chinese government, that shouldn't stop everyone from being pleased for these health workers. Many from the whole of China went to Wuhan to help wirth the outbreak, and it must have been hell.