China is still a heavy-handed command economy in many ways. The Communist Party's reputation and 'people authority' is directly tied to the economy delivering continual material progress gains (which the party then takes a lot of credit for, with the downside being the implied responsibility if things go badly). The desperation stems from 2007-2009, when the global economy crashed, and ended their over-boom (some of it was fake, backed by highly leveraged consumers and a slightly cheap currency that had been pegged to an artificially cheap dollar). At that point, China made a decision to inflate bubbles rather than accept much slower growth. The real estate bubble bought them a couple of years before it turned back against them.
China is now eating through their capital reserves rapidly, while trying to prop up the most over-valued stock market on earth, and simultaneously dealing with a manufacturing sector that has been shrinking for five straight months (to go with the big bust in several specific segments like steel). They're trying to fight reality, when they should have instead learned from Japan's similar past mistakes in trying to prop up fake growth with bubbles (China is even making the same zombie corporation mistakes that Japan did).
In the past 20~ years the leaders in China are graduated from the best engineer school in China, the current one is far from that, somehow he became overly confident and to some extent reckless, I feel that's one way to explain what are happening there nowadays, including this busted stock cycle.