Two months into the coronavirus epidemic in China, tens of millions of people are still under quarantine and much of the economy remains in a deep freeze.

Yet China has largely succeeded in keeping its stores filled with food and other essentials—even in hard-hit places like the city of Wuhan—a crucial factor in maintaining public order throughout...