North Korea is an isolated, impoverished, impulsive rogue nuclear state ruled by a family that has built one of the most terrifying personality cults the world has ever seen.

As result, Pyongyang doesn't have a lot of friends.

The one country that North Korea can depend on is China. Beijing provides Pyongyang with much of its food and weapons — and is bound by treaty to support the North in the event of war with South Korea. China and North Korea have a reputation for being closely aligned, both militarily and ideologically.

Except that Sino-North Korean relations are not what they once were. More and more, Beijing views Pyongyang as a liability. And that's leading to some seismic shifts in Asia's power dynamics.

After 20 years of sustained growth, China is an economic powerhouse and a regional military power with expanding ties to the rest of the world. North Korea, by contrast, has clung to political and economic systems that have bankrupted and starved its people. Pyongyang has pursued nuclear weapons over other countries' nearly unanimous opposition.

North Korea doesn't seem interested in changing. Nor in listening to other governments.

Indeed, as former president Kim Jong Il's health deteriorated near the end of his 17 year rule, Beijing met with American delegations to talk about cooperating in the event of North Korea's collapse.

As it turned out, Kim Jong Il's son Kim Jong Un took over leadership in 2011, forestalling a statewide implosion. Kim Jong Un continued his father's aggressive rhetoric. This, along with strengthening trade ties between China and South Korea, is fundamentally changing China's relationship with its troublesome ally.

Erstwhile alliance

The Democratic People's Republic of Korea actually predates the Peoples' Republic of China. Under the leadership of Maj. Kim Il Sung, an anti-Japanese guerrilla fighter-turned-Soviet army officer, the North Koreans offered refuge and material support to Mao Zedong's Chinese communists as they consolidated their hold over Manchuria.

Korean and Chinese communists had fought side by side against the Japanese and several Korean communists participated in the Chinese civil war under Mao's banner. In thanks, the new Chinese regime pledged to support North Korea if the latter were ever in peril.

But Beijing apparently didn't realize that it would have to make good on that promise almost immediately, as DPRK troops launched an invasion of the Republic of Korea, only to be driven back by American and U.N. forces. When the Americans began pushing into North Korea, China came the rescue.

Hundreds of thousands of Chinese soldiers died in the Korean War, including Mao's own son Mao Anying — killed in a U.N. napalm strike. He's buried in Pyongyang.

The war pushed Beijing and Pyongyang closer together. In 1961, the two regimes signed the Sino-North Korean Mutual Aid and Cooperation Friendship Treaty, which has been renewed twice and won't expire until 2021.

Despite tensions during the Sino-Soviet split in the 1960s and some brief border skirmishes during the Cultural Revolution, the Chinese-North Korean relationship remained strong throughout most of the 20th century.

Chinese and American troops at a joint humanitarian assistance drill in Hawaii | (U.S. Army Photo/Courtesy War is Boring)

The honeymoon ends

Times have changed … and so has the alliance. "It's very much a residual alliance — and a very distrustful one," Prof. Adam Cathcart, a lecturer at Leeds University in London and the editor-in-chief of the Website Sino-NK, tells War is Boring.

U.S. president Richard Nixon's 1972 visit to China spurred a series of reforms in the Asian country, including increased trade and engagement with former enemies. Beijing formally established relations with South Korea in 1992 and also increased trade and political engagement with Japan.

While China reformed and prospered, North Korea calcified and starved. Famine killed millions. Kim Il Sung, once portrayed in state media as merely a strong leader, by necessity ascended to near-godhood … all in order to head off revolt.

The Kim dynasty inculcated a state philosophy called Juche, literally meaning "self-reliance." Juche is hostile to outside ideas and encourages cultural and economic isolation.

Beijing and Pyongyang are developing in opposite directions, straining their old alliance to the breaking point.

"[North Korea's] commitment to Juche and isolation disgusts the Chinese, just as the North Koreans are disgusted by China's reforms and their willingness to talk to the Americans and the South Koreans," Cathcart says.

This tension reached a fever pitch under Kim Jong Il's rule. North Korea acquired nuclear weapons in 2006 — against China's wishes. South Korea, Japan, the United States, Russia, and China called for six-party talks with North Korea in an attempt to defuse Pyongyang's escalating belligerence.

Amid this, Beijing's official statements remained clearly pro-North Korean. The official line from the Chinese People's Liberation Army was that the two countries were "as close as lips to teeth."

South Korean troops transfer to Chinese troops the remains of Chinese soldiers killed in the Korean War | (ROK Ministry of Defense/Courtesy War is Boring)

Looking south

Now even the rhetoric is changing. Some Chinese academics and journalists have revisited the longstanding Chinese Communist Party line that the Korean War was the result of outside aggression. There's an increasing willingness in China to accept a truth that has long been taboo, that North Korean soldiers fired the first shots that triggered the war.

Closer ties between China and South Korea help explain the shift in thinking. Beijing has surpassed Washington as Seoul's biggest trading partner. Chinese businessmen and tourists are a fixture in the South, far more than they are in the North.

"[South Korean president] Park Geun-hye has been very clever in her relationship with the Chinese," Cathcart says. Park has made several state visits to Beijing and has hosted Chinese delegates in return. This year, she facilitated the repatriation of 437 Chinese war dead back to China.

Kim Jong Un, on the other hand, has done next to nothing to court the Chinese. He has largely ignored Beijing's delegations to the country — usually sending low-level party members to greet them — and has showed little interest in resuming the six-party talks.

"It's been an easy decision to work with the Koreans that will work with them," Cathcart explains.

Chinese officials and business leaders have tried to encourage reform in North Korea. But their efforts have stalled under Kim Jong Un. In 2013, North Korea executed Jang Sung-taek, a leading reformer in Pyongyang who had helped court Chinese investment.

In the past, Chinese troops concentrated in Manchuria and along the border with North Korea, ready to aid Pyongyang in wartime. But in recent years, the Chinese army's priorities have changed. During a flare-up in tensions between North and South Korea last year, Chinese troops mobilized not for combat, but for disaster relief and the evacuation of Chinese nationals.

The Chinese "trust the South Koreans not to start an incident with the North," Cathcart says. "They don't trust the North Koreans — and are very suspicious of North Korean military adventurism."

The Chinese crave stability. North Korea, which once served as a comfortable buffer between China and the U.S. troops stationed in South Korea and Japan, is anything but stable.

That's bad for business. Increasingly deprived of its only major ally, Pyongyang is bound to become even more isolated, impoverished … and desperate.

From drones to AKs, high technology to low politics, War is Boring explores how and why we fight above, on, and below an angry world. Sign up for its daily email update here or subscribe to its RSS Feed here.