The world is rightly abuzz with the news that South Korea and North Korea exchanged artillery fire this week. The decades-old conflict in the Korean Peninsula remains one of the world's major flashpoints, and North Korea is easily the world's most demonic regime (unless you count ISIS as a regime).

The conflict is largely seen in terms of geopolitics, but it would really make more sense to look at it from the perspective of North Korea's domestic politics. Totalitarian regimes are mostly driven either by ideology or internal politics, not realpolitik as much. Nazi ideology was a better predictor of Germany's actions under the Third Reich than realpolitik considerations (which was the great mistake that both Neville Chamberlain and Joseph Stalin made in their dealings with Hitler).

In this case, North Korea's reigning ideology — Juche, a combination of communism, mercantilism, and racism — doesn't tell us much. What we do know is that Kim Jong Un is probably a weak leader, and is acting to shore up his support.

Even on its best days, the regime teeters on the brink of collapse, simply because most of its people are starving and unhappy. It would take only a tiny push for the straightjacket of terror that keeps the regime together to fall apart, for enough people to become more hungry than scared, and for enough regime thugs and mid-level officers to say, "No, not this time, we won't pull the trigger."

The regime's attempt to black out all outside information has been showing cracks. Cell phones and DVDs (and probably Bibles) are streaming in from the Chinese border, where guards are easily bribed. This contraband is showing an increasing number of North Koreans that another way of life is possible. Various market-driven "reforms," while improving the lot of a few ordinary North Koreans, also highlight the regime's dons for what they are: corrupt kleptocrats, businessmen with guns.

It's against this backdrop that we need to look at the regime's recent actions. Everything suggests that Kim Jong Un feels himself to be in a position of weakness. He was allowed to succeed his father basically because the alternative was civil war and regime collapse. He needs a power base, and that means the military, and especially the more hardcore elements in the military. Hence the purging of Hyon Yong Chol, the grown-up in charge who probably thought the young Kim would be his puppet. Hyon was a military man's military man — formerly in charge of the regime's all-important nuclear program — but he was also close to the Chinese and (as far as we can tell given the murkiness of the regime) an advocate of mostly letting sleeping dogs lie.

Stirring up trouble abroad to shore up the base at home is the oldest trick in the tyrant's book, and there seems to be little alternative explanation to the artillery strikes. North Korea feeds itself two ways: Chinese aid, and nuclear blackmail against the West and South Korea. Purging Hyon alienated the Chinese, so now it's back to Plan B, a replay of Kim Jong Il's breakneck nuclear program in the 1990s that irked the Chinese. He played the Clinton administration for suckers, extorting food aid in exchange for nuclear promises never kept. (You would think a Democratic administration would learn the lesson of listening to a tyrannical regime's nuclear promises — but that's a subject for another day.)

So as we look at what is happening in the Korean Peninsula, the main question shouldn't be about balance of power, but about what we do when the North Korean regime collapses. Because it's certainly not a matter of if, but when.

To say that it will be a humanitarian disaster is an understatement — virtually all of North Korea's inhabitants are malnourished. But it will also be a security disaster, as countless weapons go unaccounted for, and the society devolves into anarchy. And of course, there's the question of nuclear weapons.

China will want to preserve its interests and keep a buffer between its borders and the American presence in South Korea. It will be reluctant to let international aid (an effort that will, by necessity, be led by the U.S.) into the country. At the same time, it will also be extremely reluctant, if not unable, to take on that duty itself.

We know that there have been talks between Chinese, South Korean, and U.S. leaders about contingency plans in the event of a North Korean collapse, but it looks like the talks stayed at the drafting stage. This is not good enough. This is not nearly good enough. History teaches us that governments are inevitably ill-prepared for catastrophic contingencies, even when they can be anticipated (and this one certainly can). It is not an exaggeration to say that it can make the difference between life and death for millions of people whether the international community has its act together when North Korea collapses.