China has long served as North Korea’s primary and most powerful ally, accounting for the vast majority of North Korea’s export market and serving as the commanding big brother who’s willing to stand toe to toe with the superpowers of the West in favor of Kim Jong-un’s reclusive state, but even China’s tolerance for Kim’s continued aggression seems to be waning. In order to understand why, we first need to understand why China was willing to support North Korea in the first place.

From the outside looking in, it can be difficult to wrap one’s head around why China, a global economic power that is feverishly expanding its military capability, would want to risk conflict with the United States. The United States is woefully unprepared for a military conflict with a “near-peer” like China, so it seems unlikely that either nation would revel in the opportunity to start shooting at each other. Moreover, China makes a lot of money in U.S. markets, and that money would dry up if relations between the two countries were to sour to the point of war.

The combination of the potential for a bloody and drawn-out conflict that would certainly involve many other nations and could potentially devolve into a third world war, combined with the financial repercussions of even winning a war against their biggest customer base, should be more than enough to convince China to play nice, one would think. So what benefit does siding with a despotic dictator ruling over a weak nation with a struggling economy possibly serve?

It really all boils down to one thing: stability.