While South Korea, Japan, and the United States are worried about the possibility of North Korea firing nuclear missiles at them, or using the threat of an attack to blackmail them, China has no such anxiety about its neighbor. North Korea needs China for its economic survival and to keep it safe from serious international pressure; there’s no chance it would risk a military confrontation of any kind.

What may be less intuitive, however, is that China sees North Korea as a shield of sorts as well. That’s crucial to understanding why Beijing has been reluctant to lean too hard on North Korea with economically punishing measures to end its nuclear and missile programs.

If Kim Jong Un’s regime were to fall apart, it would cause chaos and likely send millions of poor, starving North Koreans fleeing over the border into China. It also could lead the US to increase its military presence in the region while deploying special forces to secure the North’s nuclear weapons.

Beijing has even bigger strategic concerns when it looks down the road. North Korea’s hermit kingdom stands between China and the affluent democracy of South Korea. China likes the fact that South Korea’s potentially alluring alternative to its own style of governance and economic management doesn’t actually run up against its borders.

But if North Korea were to collapse and the Korean Peninsula became united again under Seoul’s control, that alternative model would be right on China’s doorstep.

Yet a united Korea wouldn’t simply expand Seoul’s power and make it a fiercer competitor with China — it would also boost the reach of its allies. South Korea has a deep alliance with the US, whose sphere of influence would then also run right up to China’s borders. The US has nearly 30,000 troops stationed in South Korea, and it could park even more there under a united Korea.

In addition to all this, China also has a kind of politico-cultural sympathy for North Korea’s current lot in life. “China sees North Korea and sees a backward country, under threat from the US, and they see their own past,” Bonnie Glaser, the director of the China Power Project at the Center for Strategic and international Studies, told me. “They know the history of their own country was to transform itself from a closed, isolated country to one that was open economically, and had tremendous success.”

In Beijing’s ideal scenario, North Korea would follow in China’s footsteps, taking steps toward a market economy and creating modest openings in civil society. Robert Kelly, a professor of international relations at Pusan National University in South Korea, said that China would ideally like to see North Korea evolve into a post-communist reformist dictatorship that resembles a country like Vietnam.

China has long encouraged that course. But so far, Pyongyang has shown relatively little interest in reintegrating itself into the world, and appears fixated on developing nuclear weapons with as much fanfare as possible.

So China is caught in a bind. It wants a stable North Korea. But the North’s aggressive rhetoric and continued ballistic missile tests — to say nothing of a possible nuclear test — are making the international community inclined toward far-reaching sanctions that could destabilize North Korea by crippling its economy. And a military confrontation would also cause the kind of chaos China wants to avoid.

That leaves China feeling that it has to do something. But it seems willing to do far, far less than what the US would want.