On the Apothecary’s shelf in the Northeastern Chinese city of Dandong sit small bottles of “frog oil”–a traditional Chinese remedy collected from female frogs’ egg sacs. “It’s very good for blood circulation,” says the Chinese shopkeeper. But he has a sourcing problem–the frogs come from neighboring North Korea, where business takes a backseat to geopolitics. “The sanctions have hit my business hard,” he says, requesting anonymity for fear of running afoul of the government. “Before I could easily get 50 kg [110 lb.] of frog oil–now, only 5 kg [11 lb.].”

Perched on the Yalu River, which forms most of China’s border with North Korea, Dandong is about as close as you can get to the Hermit Kingdom. The city of 2.5 million is famed for rare North Korean contraband such as blueberry liquor, “7.27” brand cigarettes, medicinal sea cucumbers–and frog oil, which fetches up to $450 per kilo. But since China signed up to the U.N.’s toughest sanctions against North Korea yet in March, after Pyongyang’s fourth nuclear test, the daily caravan of trucks rumbling over Dandong’s iron bridge from the North has slowed to a trickle. This has hit the pockets of Chinese purveyors of contraband, not to mention the regime of North Korea’s Supreme Leader Kim Jong Un. China accounts for 90% of North Korea’s trade, most of which passes through Dandong. “North Korea still wants to buy and sell a lot of goods, but because of the sanctions the cash flow of North Korean companies is limited, meaning their buying power is weak,” says one Dandong trader.

But even stronger sanctions have failed to weaken Kim’s belligerence. On Sept. 9, North Korea conducted its fifth nuclear test–the largest to date, with a yield of some 10 to 20 kilotons, comparable to the Hiroshima bomb. Worse, unlike in earlier tests the bomb was described as a “nuclear device,” which suggests the North is moving closer to being able to miniaturize a nuclear weapon and put it in a missile. The test prompted worldwide condemnation, and President Barack Obama reiterated that “the United States does not, and never will, accept North Korea as a nuclear state.” But it’s become increasingly clear that the one country that might be able to stop that from happening–China, North Korea’s only ally–won’t take the necessary hard steps. “The Chinese endgame is the survival of North Korea as a state and leveraging whatever benefits they can along the border,” says Adam Cathcart, an East Asia expert at Britain’s University of Leeds. Which means the next U.S. President may be forced to deal with a far more dangerous North Korea.

The Korean peninsula has been a hot spot for decades. Pyongyang routinely threatens to turn Seoul and U.S. cities into “seas of fire,” and, in recent years, has sunk a South Korean naval ship and shelled South Korean islands. Attempts to coax better behavior with aid have failed dismally. Since six-party denuclearization talks were suspended in 2009, Pyongyang’s pariah status has only deepened, even as its nuclear-weapons program has matured. In 2016 alone, the regime has already conducted two nuclear tests and 20 missile tests, and analysts believe the North has the ability and atomic material to test another nuke at any moment. No amount of U.S. carrot or stick has reduced the regime’s truculence. “Both internally and externally, North Korea always resolves any kind of political dispute through violence or the threat of violence,” says Daniel Pinkston, an East Asia expert at Seoul’s Troy University.

Nearby South Korea and Japan are most immediately at risk from a nuclear-armed North Korea, though last year analysts at the U.S.-Korea Institute concluded that by 2020, Pyongyang could field an intercontinental ballistic missile capable of reaching the continental U.S. But Kim’s intransigence has become an increasing problem for China. On July 7, Seoul and Washington announced that South Korea would host the U.S. Terminal High Altitude Area Defense (THAAD) anti-ballistic-missile system. Also known as hit-to-kill technology, THAAD batteries have no payload but destroy enemy missiles by colliding with them at high velocity. THAAD is designed to help protect the U.S., Japan and parts of South Korea from North Korean attacks. But Beijing–already tangling with Washington over the South China Sea–sees the deployment of THAAD on the Korean peninsula as a direct threat. “China believes the development of THAAD puts its hegemony at risk,” says Cheong Seong-chang, senior fellow at the Sejong Institute, a Seoul think tank.

For the U.S., THAAD could protect troops in the field, but potentially at the expense of alienating the only country that may be able to alter North Korean behavior. Pyongyang and Beijing had been at odds–Kim and Chinese President Xi Jinping have yet to meet, even as Xi has assiduously cultivated South Korean President Park Geun-hye, and there was no Chinese official at North Korea’s once-in-a-generation Workers’ Party Congress in May, where Kim assumed the role of party chairman. But representatives from the Chinese military and security services reportedly visited North Korea July 27 to mark Korean War Victory Day, hinting at a thaw in Chinese–North Korean relations after the THAAD deployments.

Yet what might be even more worrying than a Chinese–North Korean rapprochement is the possibility that even Beijing’s influence over Pyongyang is limited. Pyongyang’s latest satellite launch coincided with China’s sacrosanct Spring Festival holiday in February, and its most recent nuclear test followed immediately after the September G-20 meeting in the Chinese city of Hangzhou. “I don’t think Beijing has any effective influence over Pyongyang,” says Shi Yinhong, professor of international relations at Beijing’s Renmin University. “North Korea keeps trying to embarrass China.”

Mao Zedong famously said that China and North Korea were as close “as lips and teeth,” and his eldest son died fighting for the North in the Korean War. But North Korea’s founding father Kim Il Sung’s guiding principle of juche, or patriotic self-reliance, meant that his nation would never be anyone’s puppet. Kim was a masterful puppeteer himself, playing his Chinese and Soviet benefactors off each other during the Cold War like two feuding parents.

Now only the Chinese parent remains, and familial ties have soured. To Beijing, the North Koreans are dangerous renegades, while the North Koreans resent Beijing’s market reforms, believing ostensibly communist China has become a capitalist traitor. “As overseas Chinese, we were not welcome in North Korea,” says one Pyongyang-born ethnic Chinese trader in Dandong. “It was impossible for me to join the army or even go to university. So after I graduated from high school, I moved to China.”

Yet continued Chinese support for North Korea has never really been in doubt, for two key reasons: Pyongyang’s fall would rob Beijing of a buffer against a U.S.-allied united Korea. And secondly, the collapse of the Kim regime would almost certainly send a ruinous flood of millions of refugees north into China.

North Korea’s race for the bomb has shifted that paradigm somewhat, prompting Beijing to carefully turn up the pressure on its wayward neighbor. U.N. sanctions passed in March impose new restrictions on North Korean shipping and banking, and prohibit the sale of supplies such as aviation fuel that could have a military purpose. But having China on board means its effects have been far broader. Sipping fruit tea in a Dandong florist-cum-café, one trader describes how his business importing North Korean coal and minerals and exporting building materials has been eviscerated by the sanctions. “North Korean traders don’t have cash anymore,” he says. “I have to limit the amount of goods I sell to them on credit as the risk of default is so high.”

The very fact that North Korea can be hit by sanctions points to how the country has changed. While his grandfather and father ruthlessly cracked down on private enterprise, Kim Jong Un has been more selective. Currency-wiring services are flourishing, thanks to a loosening of controls, with thousands of North Korean defectors in South Korea sending a steady stream of cash back home. But maintaining this trajectory requires Chinese support. China has long courted North Korea to follow its example and embrace market reforms, thus providing a forum for engagement and influence. “Nothing would please Beijing more than to see North Korea move in this kind of economic development mode,” says John Delury, associate professor of Chinese studies at Yonsei University in Seoul.

Yet there’s a limit to how much North Korea will change. Just six miles (10 km) from Dandong, a new $350 million suspension bridge spans the Yalu River, with freshly sealed road flanked by gleaming traffic markings. An entire free-trade zone of shops, warehouses and a pastel forest of 20-story apartment buildings has been built on the Chinese side. But for the most part these shops lie empty, as the North Koreans have done nothing on their side of the river–no customs buildings, duty free shops, offices. The bridge plunges abruptly into fallow cornfields. “They built this zone for cross-border trade, but there is so little that only local businesses occupy the lots,” says Su Li, owner of a furniture warehouse in the trade zone.

Pyongyang’s isolationism means it has devised darker ways to bring in foreign capital. Supplies of narcotics, particularly crystal meth, and counterfeit pharmaceuticals and currency continue to be smuggled into China. Yu Dong-yeol, director of the Korea Institute of Liberal Democracy in Seoul, told a defense security conference on July 7 that Pyongyang runs 6,800 professional hackers, engaged in fraud and blackmail, and an online gambling ring that together generate annual revenue of $860 million. The 2014 hack of Sony Pictures in response to The Interview, which lampooned Kim, would seem to demonstrate this communist fossil’s surprising technological prowess.

The regime is also dispatching workers abroad. About 50,000 to 60,000 North Koreans labor in factories, fields and restaurants–most commonly in China, but also in Russia and the Middle East. Their below-standard wages are collected directly by the regime, with only a fraction reaching the workers themselves. Assorted North Korean government departments run around 130 restaurants in foreign cities such as Beijing, Yangon, Dhaka, Vladivostok and Phnom Penh. Dandong has many, with the largest employing more than 200 North Korean staff.

These establishments demonstrate that China is engaged in half measures at best against Pyongyang. Beijing could send all North Korean workers home, which would cut off a vital source of currency. Foreign labor is worth $300 million to the regime annually, according to the Seoul-based Database Center for North Korean Human Rights. Supplies of luxury goods like flatscreen televisions and DVD players–key to keeping the North’s military elite in line–could also be blocked. More crucially, Beijing could suspend the half-a-million tons of crude oil that flows each year through the pipeline located near Dandong. These are options Washington would like to see on the table. Speaking at the close of the ASEAN summit on Sept. 8, Obama said of China’s Xi that “if THAAD bothered him … they need to work with us more effectively to change Pyongyang’s behavior.”

In response to the latest nuclear test, Hillary Clinton advocated dialogue with Pyongyang, similar to the negotiations with Iran over its (far less advanced) nuclear program. Her Republican opponent, Donald Trump, has previously also vowed to cut “a good deal” with the Kim regime. But it’s possible that little can be done in Washington to stop the North from pursuing nuclear weapons. According to Troy University’s Pinkston, North Korea sees nuclear capability as a “necessary condition for economic development and prosperity.” It’s simple realpolitik. Kim is aware of the fate of Libya’s Muammar Gaddafi and Iraq’s Saddam Hussein, two autocrats who abandoned their pursuit of nuclear weapons under international pressure only to be overthrown in the end. For him, an atomic bomb is an equalizer, securing his family’s legacy while forcing the global community to treat Pyongyang as an equal. “They think it brings respect and prestige,” says Pinkston.

In truth it brings neither, though it does guarantee something more important to Kim: security–albeit security that only the regime enjoys. The millions of ordinary North Koreans across the Yalu River are still living in unimaginable poverty and Stalinist oppression. Just days after the latest nuclear test, North Korea was hit by a flood so devastating that it had to make a rare public appeal for help. Kim has played his hand well, splitting his enemy the U.S. and his ally China. But the North Korean people are still losing. They always do.

–With additional reporting by ZHANG CHI/DANDONG

Write to Charlie Campbell at charlie.campbell@time.com.

This appears in the September 26, 2016 issue of TIME.

SPONSORED FINANCIAL CONTENT

Read More From TIME

EDIT POST