Here is an interesting historical analysis of the Chinese, Russian, and North Korean relationship during the early years of the Kim Il-sung regime. This historical analysis does have some interesting parallels on why the Chinese government continues to support the Kim Jong-un regime today:
From left to right: Mao Zedong, Nikita Khrushchev, Nikolai Bulganin, Anastas Mikoyan, Mikhail Suslov, Kim Il-sung, V Shiroky, and Enver Khohgha, At the celebration of the 40th anniversary of the October Socialist Revolution, 1957.
But for all the frustration, North Korea is an important piece on Beijing’s diplomatic board. If played incorrectly, it could backfire on China to the detriment of its bid for global leadership. Bringing Kim to his knees on behalf of the international community does nothing to advance Xi’s vision of a China-centered order in East Asia.
This is not new. Beijing has played this game before—most disastrously in 1956, when then North Korean leader Kim Il Sung brutally purged his political opponents suspected of ties to China and the Soviet Union. Moscow and Beijing intervened on their behalf, but Kim outplayed his allies with Machiavellian guile.
The crisis was also a turning point for China’s relations with North Korea. It was in 1956 that Beijing realized it had to go easy on Pyongyang, despite Kim’s maddening obstinacy, because the alternative was to surrender the country to the Soviet influence. As difficult as Kim was, he kept his distance from Moscow, and he could be an important ally in Beijing’s bid for leadership in the socialist bloc. Overnight, North Korea became an issue in China’s relationship with the Soviet Union, much as today it complicates China’s relationship with the United States. [China File]
Here is some interesting dialogue between Chinese premier Mao Zedong and the Soviets based off of records released from the Soviet archives:
Mao agreed with Mikoyan that there were serious problems in Pyongyang. Himself a ruthless dictator, Mao claimed Kim, who “still does the Stalin thing,” appalled him. “He brooks no word of disagreement and kills all who tries to oppose him,” Mao said.
But he claimed that China had no influence on the North Koreans. “This time we have to mainly rely on you,” he told Mikoyan. “They won’t listen to China!” Mikoyan retorted that Moscow’s leverage was hardly any better, but Mao disagreed: “They won’t listen to China 100 percent of the time. They won’t listen to you 70 percent of the time.”
Mikoyan said he simply did not understand why Kim was acting this way. Mao knew why: “He is afraid that our two parties are digging under the wall [of his house].”
And Mao, sensing, rightly or wrongly, that Moscow was plotting Kim’s ouster, warned the Soviet envoy they should not try to topple him. The Chinese leader opposed the Soviet practice of overthrowing recalcitrant tyrants. Nor did he think Kim’s regime was as bad as the Soviets claimed. After all, Mao’s own regime was not exactly democratic either. If he helped bring down Kim’s house, he would set a precedent that could one day be used against him.
There was another reason for Mao’s hesitation. He was beginning to challenge Moscow for leadership in the socialist camp. He accused the Soviets of arrogance, and of trying to impose their will on other countries. Much as he feared letting Kim get away with brutalities would lead to North Korea’s collapse, he did not want the Soviets to use him as a proxy.
You look at what is happening today and you see the parallel that the Chinese do not want the Kim regime toppled and have continued to oppose attempts by the US to impose its will on other countries around the world to include North Korea.
It is worth reading the whole article at the link.