How has the Chinese Communist Party, to date, been able to retain power while that of the Soviet Union lost control of the state apparatus?
For many years under Mao, China was an isolated country—both economically and diplomatically. This made it much more difficult for the dominance and control of the ruling Communist Party to be challenged. Also, from its inception Chinese Communism was inextricably linked with Chinese nationalism in a way it was not in other communist countries. The Chinese Communist Party (CCP) had played a leading role in fighting the Japanese during World War II and so gained a reputation as being an effective defender of Chinese national interests. In the eyes of many, the CCP was the Chinese nation, as prior to World War II there was no independent China.
As the Soviet Union was the inheritor of a multiethnic state that had existed for centuries, there was no automatic identification of the ruling Communist Party with Russian nationalism. Also, it was the various ill-suppressed nationalist tensions within the Soviet Union which helped to bring about its eventual collapse.
Because of its relative isolation, China didn't find itself becoming mixed up in the kind of overseas entanglements that eventually dogged the Soviet Union. The Chinese did intervene in the Korean War, but as that conflict was right on its border; it could be more effectively managed than, say, Soviet involvement in Afghanistan. The Soviet Union also had to maintain effective control over the Eastern Bloc countries, and there was nothing comparable to this in the case of China.
Finally, economic reform in China has been kept strictly in the hands of the governing CCP. Although China has become a rapidly developing capitalist economy over the last thirty years or so, the overall strategic direction of the economy remains firmly under the control of the one party state.
First of all, we must note that it is impossible to answer a question like this with complete certainty. It is never 100% clear what causes human events to occur as they do. We can conjecture, but we cannot know for sure.
The most likely answer for this has two parts. First, China was more successful in modernizing its economy and making its people wealthier. Second, China was more careful about limiting the amount of political freedom that it allowed its people.
One of the main problems that the Soviet Union faced was a lack of economic development. Its people became tired of a lack of material goods and became rebellious. China did better than the Soviet Union in this regard. It began to open up its economy under the leadership of Deng Xiaoping. When it did so, living conditions began to improve. This kept its people more contented than the Russian people were.
At the same time, China was much more cautious than the Soviets were. Gorbachev tried to implement both political glasnost and economic perestroika at the same time. The Chinese did not try this. Instead, they opened their economy but kept their political system under tight wraps, as can be seen in the 1989 Tiananmen Square episode.
The Soviet Union tried to open both its economy and its political system. By contrast, the Chinese worked on improving their economy and kept their political system tightly controlled so that no serious dissent can work to take power away from their communist party.