It's essentially the consequence of short-termism in a command economy. The Chinese government realised, in the 1970s, that they needed to bring the population under control, so they instituted a one-child policy. This was massively beneficial in the short-term, allowing relative family wealth to rise as families had to look after fewer children, but ends up producing a population decline that comes on rapidly, as you end up with two problems. The first is that, in a patriarchal country, families want sons, and you end up with significant sex imbalances. The second is that, as children are expected (and in some cases legally required) to look after their parents, you end up with people choosing not to have children themselves, as they can no longer afford it.
And, of course, China is now discovering that it is easier to stop people from having children, than to make them have bigger families. Moreover, there was an expectation that economic growth would allow the state to offset the consequences of the population shift, where it is now becoming apparent that much of the wealth generated in China is being sucked into a massive real-estate bubble.
A few years ago, the expectation was that the population of China would decrease after 2050. Then it was revised to 2030. Right now, it looks like the Chinese National Bureau of Statistics will report a decline this year, and that they may be lying, and that the population has already started to take effect.