In a socialist state like China before Dengism or the USSR, how would unions work? Under capitalism unions are fantastic, but if you have a socialist economy, an independent union is essentially bargaining with all of society. A union with a lot of leverage, such as dockworkers, could extract inordinate concessions from the rest of society, not the capitalists. They would become a resented labour aristocracy. Now, I don't think this holds in post-Deng China, but from my understanding there is a fair amount of labour organizing going on there. For instance, a few years ago an American business owner owed a bunch of back pay to his Chinese employees, and they suspected he was about to lay everyone off and close the factory without paying them, so they took his ass captive. They trapped him in his office and the police didn't raise a finger to free him. Fat chance in hell that you'd see that in any western country.
As for public healthcare, there is, it's just not completely free. The cost is very low, however, and the same goes for high shool. They just recently expanded affordable public childcare as well. Their recent anti-poverty program was also very successful.
To take a step back, I think you aren't correctly understanding why western countries have/had a social safety net and toleration of unions. A lot of it was due to the struggle of the domestic labour movement, yes, but a big part of it was also the threat of the Soviet Union - with a prominent alternative to capitalism, they had extra incentive to keep the domestic working class placated. In short, they bought us off by sharing some of the spoils of imperialism. However, with falling rates of profit and the continual drive to increase profit, they've been progressively dialing it back in successive rounds of austerity, while letting wages stagnate compared to the cost of living. These social programs are only going to degrade and be dismantled over time.
How is this distinguished from post-Deng China? On one hand, China does not have a global empire to extract profits from, so the steadily increasing standard of living for their working class is a result of their successful economic program rather than them paying off the working class with a share of the plunder. The increase has not been equal, with the standard of living in cities increasing more rapidly than in rural areas, and with the bourgeoisie getting richer faster than the proletariat, but it is nevertheless a general increase across all of society, while the western pseudo-democracies are seeing exponential enrichment for the ruling class combined with stagnation in the middle and worsening conditions for the working class.
The main reason, however, is that capital is not in control of China. Capital is allowed to exist, and has a seat at the table, but it is constrained by the state. If capitalists cross certain lines, if they get too corrupt, act against the national interest, or act egregiously against the interests of society, they are dealt with very harshly, up to and including execution. Jack Ma got too big for his britches and thought he could freely criticize the state banks and financial regulators, claiming that they were stifling innovation. The state made it quite clear who was in charge, and Ma disappeared from public life for about 6 months. China has billionaires, yes, but they keep them on a fairly tight leash, and they routinely execute them.
Once again, they aren't perfect and I have plenty of criticisms, but they're doing so much better than any western country, where capital is unconstrained, operates with impunity, and is stripping the copper wire from the walls to chase profits. It's basically incomparable. Chinese people, having seen concrete and rapid increases to their standard of living, are optimistic hopeful for the future, while we in the west see only doom and worsening conditions.