The demographic timebomb is a threat to the profitability of capitalism, which is predicated on infinite growth. Fewer people means less labor to exploit and less consumers for products, both of which are devastating to the growth of profit.
A socialist society doesn't much care about profit or growth, so long as the working population can produce enough goods for everyone. China is one of the biggest producers and consumers of industrial automation and robotics, so its entirely possible that by the time the population starts shrinking overall or the working population ages into retirement the productivity of the remaining working population will be more than enough to sustain everyone.