Two critical factors in China (and not in Italy) are (a) timing with Spring Festival and (b) prior experience with SARS. I'd also speculate that Chinese people are more accepting of community obligations, and Chinese family dynamics generally made the lockdown easier.
I've been in Beijing, China, throughout the whole lockdown (e.g. see an unprofessional YouTube video I made on the 15-th March). I'll share my experiences here; it may be different elsewhere in China (and definitely different in Wuhan).
Lockdown officially started some time during Spring Festival, so schools, universities, shops, etc., were already mostly shut down. During Spring Festival, virtually all Chinese people go home to visit their family (often in another city, in what is described as the largest human migration). Many people are still yet to come back from Spring Festival; you'll see many 放假 ("on holiday") signs on shops in Beijing today.
On top of this, the streets here were virtually empty before lockdown: Chinese people acted swiftly, faster than the government---they still have the horrors of SARS in memory. (E.g., shortly before official lockdown, I went to the cinema, and literally had the whole cinema to myself.)
For weeks, every day the rules would change---I could not keep up. We're currently coming out of lockdown, so I tend to think of lockdown in past tense, but some aspects are still applicable.
What did lockdown entail...
Spring Festival celebrations were cancelled, which is massive: maybe as significant as cancelling Christmas celebrations in the west.
Schools and universities did not reopen after Spring Festival. I hear they're slowly reopening in other cities, but not here in Beijing, where we have problems with imported cases of coronavirus (which is probably why China is now suspending entry to foreign nationals).
Everyone started wearing facemasks 口罩 in January and random people started telling me I should wear one. (Actually many Chinese people wore them beforehand due to pollution, so it was already socially acceptable.) But they were all sold out, so a security guard gave me one. Nowadays it's not as strict, and some people don't wear them (e.g., at a park when noone is nearby).
We need a 出入证 to get into our apartment complex. It's a slip of paper, but to get it you register your details (I think the idea is that if you fall sick, authorities can immediately disinfect and alert your neighbors---you can see mine in my YouTube video). You can only enter an apartment complex if you live there (and thus have a 出入证)---this is still the case now.
We get our temperature taken a lot. At first it was just at the gate to the apartment complex, then restaurants started doing it. I had it taken maybe 5+ times today alone---sometimes when it's high, they take my details.
Very few restaurants were open (maybe fewer than 1 in 100 [maybe 1 in 10 is open now]), and those that were open were mostly take-away only. We mostly pay for things using our phones (微信 WeChat or 支付宝 AliPay) and not physical cash, and nowadays we mostly order on our phones too. After each customer leaves, the table and seats are disinfected (still done today). But most people order home delivery 叫外卖 on their phone, and it's delivered to the gate of the apartment complex. Malls were open, but almost all the shops inside the malls were closed.
Beijing also has things like staffless shops (all self-service), and fruit and vegetable vending machines.
To my knowledge, there was no point at which I couldn't just freely walk around Beijing streets (and I sometimes did so)---I wasn't required to explain what I was doing, and I never saw police patrolling the streets to enforce lockdown. However, almost everything was closed, and it was cold outside; also I always felt like I should do my part. So, like everyone else here, I minimized going out (even learning how to cook in a kettle). [Nowadays, I go out every day, multiple times per day.]
Since January, the streets have been covered in posters giving information on what to do (see my video). Shops started marking the floor with where people should queue. Small shops block the entrance: you don't enter the store, and instead tell them what you want. Most pharmacies sell things through a small window (and customers cannot go inside).
You can buy virtually anything online in China. If it's sold in a shop, you can pay someone to deliver it. Until recently, most people outside are package deliverers, or the local equivalent of "Uber Eats". They're very efficient, combining multiple purchases, and using their phones for transactions.