BEIJING – In Donald Trump’s struggles to confront the escalating threat of North Korea’s nuclear program, one factor has always loomed large: China. Trump believes Beijing, Pyongyang’s chief ally, could take advantage of its political and economic clout to persuade North Korea’s dictator, Kim Jong Un, to cease his threatening missile launches and curtail his nuclear ambitions. “China is very much the economic lifeline to North Korea so, while nothing is easy, if they want to solve the North Korean problem, they will,” he once tweeted.

China, though, insists its hands are tied. Trump, the Chinese claim, overestimates their ability to influence their unruly Stalinist neighbor. “The so-called ‘China responsibility theory’ is based on a poor understanding of the nuclear issue on the Korean Peninsula, as well as baseless efforts to shift responsibility for the complicated problem onto China,” went one typical comment in a Communist Party newspaper in August.

Who’s right? It is true that the relationship between Beijing and Pyongyang can often be more strained and tempestuous than Trump seems to believe. But a look at North Korea’s economic relations with the world shows that China’s leaders clearly hold leverage over Pyongyang – perhaps even the power of life and death – if they choose to use it. “The Chinese government is the major supporter of the DPRK,” says Nicholas Eberstadt, a specialist in political economy at the American Enterprise Institute, using the acronym for North Korea’s official name, the Democratic People’s Republic of Korea. “The DPRK is such a dysfunctional economy that it requires a steady stream of subsidies from abroad to prevent it from going into vapor lock.”

Eberstadt’s statistics expose how, as he puts it, China is “the only game in town” for North Korea, at least when it comes to merchandise trade. In 2014, the latest year of data, China bought two-thirds of all of North Korea’s exports, worth $2.6 billion, and provided almost as large a share of the country imports, at $3.9 billion. More critically, China’s importance to North Korea has grown significantly during the past two decades, as Pyongyang’s economic ties to the rest of the world have withered (most notably, with Russia, which had been a major patron.) In 1990, China accounted for less than 6 percent of North Korea’s total exports and only 13 percent of its imports.

Those figures may not tell the entire story. Eberstadt says the relationship between China and North Korea is so opaque that it is difficult to understand the true extent of their economic exchange. North Korea doesn’t release economic data, and the official statistics from the Chinese government could understate the amount of their trade. For instance, China is almost certainly the largest provider of oil to North Korea, but that may not be reflected in Chinese data.

China’s trade with North Korea has also helped Pyongyang dodge United Nationssanctions, imposed by the Security Council to compel Kim Jong Un to the negotiating table. In a September report, a U.N.-sponsored panel of experts concluded that North Korea “continued to export prohibited commodities,” which helped the regime raise much-needed funds. By the panel’s count, Pyongyang earned $270 million from such illegal exports over a recent period of several months. China figures prominently in this trade by buying silver and other restricted commodities. For instance, China’s imports of iron and steel from North Korea reached $37 million – more than 80 percent of Pyongyang’s total sold abroad – during that time period.

China also helps North Korea evade sanctions that are supposed to block its access to the international banking system. Agents of North Korea, for example, are known to register companies in Hong Kong, set up offices in China and then utilize Chinese banks to conduct foreign financial transactions.

William Newcomb, a visiting scholar at the U.S.-Korea Institute at Johns Hopkins University, and a former deputy coordinator of the U.S. State Department’s North Korea Working Group, believes that Beijing could and should be taking sterner action against such illicit networks. “China has an extraordinarily good security service. I don’t believe for a minute that they don’t know who the North Koreans are and what they’re up to and who’s working with them but we don’t see any kind of follow-up.”

The Chinese do seem in recent months to have upped their efforts on sanctions against North Korea. The U.N. report shows that China’s trade with North Korea in certain areas has declined. During the course of the year, Beijing has taken steps to more closely abide by U.N. sanctions, by, for example, banning North Korean exports of coal, iron ore, seafood and other products. Pyongyang is feeling the pinch. According to the U.N. report, China hasn’t imported coal from North Korea since February.

Still, there appears to be a limit to how far Beijing is willing to go. China fears squeezing North Korea so hard that it leads to the country’s collapse, an outcome Beijing has traditionally wished to avoid. “It is true that for political and geographical reasons, China is the ‘economic lifeline of North Korea,’ but such economic aid, from a Chinese perspective, is necessary to maintain the stability of North Korea so as to avoid a ‘hard landing’ or even an ‘implosion,’” one commentary in the Communist Party-run Global Times explained.

That’s a big reason why economic sanctions may not bring Pyongyang to heel. Earlier this month, the U.N. Security Council agreed to impose the toughest measures yet against North Korea, including a ban on its lucrative textile exports, restrictions on the ability of North Koreans to work overseas, and a prohibition on any joint ventures with the country’s companies. In theory, these measures will cut Pyongyang off from billions of dollars of income. But in the end, their effectiveness will depend on how strictly China and other countries enforce them.

“Sanctions work a lot better if China and Russia get on board and are faithful in their implementation,” says Newcomb.

Washington continues to try to prod China in that direction. The U.S. Treasury Department recently announced sanctions on Chinese business for allegedly aiding the Pyongyang regime, and has threatened to take further measures. But it isn’t clear Beijing will succumb to such pressure from Trump.

“The Chinese have been OK with North Korea’s behavior as long as it is more a problem for the U.S. than China,” says AEI’s Eberstadt. “The question is how far does the cost-benefit analysis have to change for the Chinese approach to North Korea to change in an appreciable manner?”