How borders are drawn and enforced has far-reaching consequences, whether we live on either side of them or halfway across the world.

There’s an undeveloped strip of land on the Korean peninsula where nature thrives, but wild animals occasionally explode. Walking across it would be a bad idea.

Known as the demilitarized zone (DMZ), it divides South Korea and North Korea, nations that technically have been at war since the 1950s. Running 240 km (150 miles) across the Korean peninsula, and measuring about 4 km (2.5 miles) wide, it is heavily guarded by two of the world’s largest militaries, strewn with landmines, and arguably the most fortified border on the planet.

Quartz Plenty of crossing points to the north.

If you want to flee North Korea, this is not your recommended route. It makes much more sense to head north instead toward China, where the Yalu and Tumen rivers straddle Mount Paektu to create a 1,420-km (880-mile) border. The Yalu is the deeper of the two rivers, but neither is all that hard to get across. In the winter, both can freeze over.

There’s been a lot of hand-wringing of late over North Korea and its erratic leader Kim Jong-un, with much of the world rightly alarmed over its ongoing tests of missiles and nuclear bombs—including a missile test on May 14. There’s been hope that China will apply more economic pressure against North Korea to help bring about a change.

But it’s impossible to game out scenarios for the region without taking into account the reality of North Korea’s borders. For most of the 25 million people contained within them, life is already harsh. Should central authority be replaced by civil war and competing factions hoarding resources, it would get even worse, causing potentially millions of desperate (and in many cases starving) people to head straight for China.

Reuters/Staff The frozen Tumen River, seen from the Chinese city of Hunchun in the Yanbian Korean Autonomous Prefecture. Just across the ice is North Korea.

Today Beijing considers fleeing North Koreans “economic migrants,” meaning it doesn’t have to offer them protections it agreed to under the UN’s 1951 Refugee Convention. It routinely returns North Koreans to their country, knowing that many will be tortured or executed, in part because Beijing worries that a more lenient stance might only encourage more North Koreans to cross the border.

Of course, in a crisis, they’ll cross the border in any case, in numbers that will draw the world’s attention. It would be a humanitarian disaster of epic proportions, and the brunt of it would be shouldered by China—similar to Turkey’s role in handling the refugee crisis originating in neighboring Syria. While it remains to be seen how closely Beijing will work with the US and others in addressing North Korea, it’s clear that the potential for mass migration directly into China will be a key consideration in how it approaches the problem.

Logistical challenge

China does have field experience with refugee crises. In 2009, over 30,000 refugees from Myanmar’s Kokang region flooded into the southern Yunnan province, escaping the fighting between government troops and local rebels. Many of them were ethnic Chinese who spoke Mandarin, which no doubt helped matters. China won moderate praise from the international community for providing food, emergency shelter, and medical care to the refugees.

“You could really see China’s emergency-response system kicking in, and see how China might deal with North Korea,” says Carla Park Freeman, director of the Foreign Policy Institute at the Johns Hopkins School of Advanced International Studies in Washington DC.

The fighting in Kokang flared up again in March, sending more refugees China’s way, and giving the country further experience in what might be a warm-up exercise for a far larger crisis in the northeast.

Reuters/Stringer In 2009, tents housed Myanmar refugees from Kokang in the Chinese-Myanmar border town of Nansan in Yunnan province.

In the event of a North Korean refugee crisis, the logistical challenge will require new solutions from China. Besides trying to fortify its border, it might seize control of some North Korean territory in order to create a buffer zone, in which case it would probably first try to get approval from the international community.

“I think China would look for some kind of UN authorization before moving in,” says Freeman. But, she adds, “In a crisis, China would move very, very quickly to try to secure its borders with North Korea, and try to keep the North Koreans fleeing on the Korean side of the border, and try to manage them there.”

But keeping migrants hemmed in would be no easy task. Nor would supporting Chinese troops trying to secure the long border.

“Sustainability at blocking the border would be a huge challenge—food, material, shelter for the troops,” notes Bob Collins, a former US Defense Department analyst with nearly 40 years’ experience on the Korean peninsula. “Intervention across the border to create a buffer zone will be even harder because they would be doubling their logistical challenges in supporting the refugees.”

Many of the North Koreans attempting to cross would be trying to reach friends or family within China. Across the Yalu River is the Liaoning province, home to hundreds of thousands of ethnic Koreans. And across the Tumen River is the Jilin province, which has closer to a million ethnic Koreans, most in an area called the Yanbian Korean Autonomous Prefecture. The capital of the latter, Yanji, is only about 10 km (6.2 miles) from the border.

Reuters/Damir Sagolj The sunrise over the North Korean side of the Yalu river, as observed from China’s Liaoning province.

In the event of conflict, China’s refugee burden could eventually rival that of Turkey. Sharing a border of 911 km (566 miles) with Syria—which is now in its seventh year of civil war—Turkey is struggling to provide for about 3 million Syrian refugees. While it’s had an open-door policy in the past, the country is now building a wall with a height of 3 meters (10 feet) along its Syria border, complemented by ditches, fences, and minefields.

Turkey also has spent heavily supporting Syrian refugees—and has demanded other nations pitch in on the bill. China, too, would likely seek economic assistance from other nations, especially South Korea and the US, to help it cope with the cost of supporting refugees.

Just as Turkey hasn’t been alone in dealing with the Syrian refugee crisis—Lebanon, Jordan, and Iraq have struggled, too—China wouldn’t be the only nation coping with desperate North Koreans.

Japan takes the threat seriously enough that it’s been drawing up contingency plans to deal with an influx of North Korean refugees, who would have to first survive crossing the Sea of Japan. Russia, too, has a border with North Korea, and a large population of North Koreans, especially in Vladivostok. But its border, at about 17 km (11 miles), is much shorter, and would be easier to secure in a crisis. And of course there’s South Korea, which is another story in itself. If the situation grows desperate enough, we may just see mass numbers of North Koreans trying to cross the DMZ.

A tricky balance for Beijing

As for how central authority in North Korea could break down in the first place, it could happen in a number of ways. A conflict between North Korea and the US and/or South Korea could rapidly escalate into a war. An assassination of Kim could be followed by a failed replacement effort by the ruling Workers’ Party. A manmade disaster, such as a Chernobyl-type event at the North’s Yongbyon nuclear reactor, could be the cause. It could even be an eruption of Mount Paektu, which showed signs of life in 2014 and, nearly 1,100 years ago, was home to one of the planet’s most violent eruptions in the past 5,000 years. Some worry the next nuclear test by North Korea could actually set off Mount Paektu.

However it happens, “as central control evaporates, local control by military units is quite possible,” notes Collins. “Those groups that grab the nukes will have the upper hand. This could lead to civil war, pushing North Koreans north to China, off both coasts in flight by sea, and attempts to cross the DMZ. The latter would result in more deaths than successes due to the density of military forces there.”

For decades, North Korea has served as a buffer state for China, which has long preferred having a repressed, impoverished nation next door rather than having a thriving democratic neighbor (and likely US ally) providing a sharp contrast to its own one-party rule. That’s one reason it has tolerated leadership in Pyongyang it increasingly dislikes.

But now, the Kim regime itself is in some ways the buffer, maintaining strict order and keeping North Koreans on their own side of the border.

Beijing wants to pressure the Kim regime just enough to bring it to the negotiating table for denuclearization talks, but it wants to avoid the risks associated with regime change or military action.

Looking at the borders makes it easier, at least, to see why.