What does North Korea want? The question is on many minds, especially because the nation keeps timing weapons tests—including a sixth nuclear test on Sunday (Sept. 3)—to ruin weekends and meetings between world leaders.

A useful approach to understanding North Korean leader Kim Jong-un’s thinking is, perhaps, to consider his “term limit.” Namely, that there isn’t one for the third-generation hereditary leader. Barring an overthrow, Kim has every reason to believe he’ll rule North Korea all his life (and that a son of his will rule afterwards). Now in his thirties, he can reasonably expect to be in power for decades after US president Donald Trump’s time in office.

For Kim, then, the moves he makes now are about much more than fighting sanctions or enriching the regime. They’re about securing a rather favorable future—one in which he continues to hold absolute power over a population raised to believe in the divine nature of his grandfather, his father, and himself. So what are the threats to that future?

Revered in North Korea

The closest danger would naturally come from inside North Korea. But Kim has shown that he’s ruthless about holding on to power, not hesitating to eliminate perceived enemies, including his own uncle and many senior officials.

Having only been supreme leader since 2011, Kim is not yet as revered as his father and especially his grandfather, each of whom were in power for decades. But becoming at least equally revered is no doubt one of his goals for the decades ahead. So he needs to show, especially early on, that he can stand up to sworn enemies, in particular the United States. In this regard, it’s actually helpful when Trump makes boisterous threats against North Korea. That allows Kim to rally support for his ongoing weapons tests.

Of course, it’s been impossible to ignore the heated words of the current US president. Trump said in April that “all options are on the table” in response to North Korea’s “threatening and destabilizing actions,” suggesting an American strike of some sort was a distinct possibility. But given the potential cost of a conflict, the threats likely rang hollow in Pyongyang. US defense secretary Jim Mattis said in May that any military solution to the North Korea crisis would be “tragic on an unbelievable scale.”

North Korea “called Trump’s bluff,” John Nilsson-Wright, a senior research fellow at London-based think tank Chatham House, told CNBC in July. Indeed Trump’s escalating threats, including a dramatic warning of “fire and fury” in early August, have been met with only more saber-rattling from North Korea. Nilsson-Wright noted in August for the BBC:

“The legitimacy of the Kim dynasty’s political leadership is rooted in a narrative of defence against an implacably hostile United States… The 1950-53 Korean War, framed in North Korean propaganda as the result of direct US aggression, is used to depict the United States to the North Korean people as an adversary intent on destroying the country… Mr Trump’s recent bellicose public statements are a propaganda gift to Kim Jong-un, allowing him to bolster his standing as the nation’s commander in chief and protector of the country.”

Kim Jong-un’s history lessons

Kim would garner even more credibility at home if the international community came to accept North Korea as a nuclear state. In this regard he could be trying to follow in China’s footsteps. China became a rogue nuclear power in the 1960s but was later accepted as a member of the international community, as Max Fisher noted in July in “The Interpreter” section (paywall) of the New York Times.

Today it’s hard to imagine a US president shaking Kim’s hand in Pyongyang. But it was once difficult to picture something similar happening in Beijing, too. As Fisher notes, Kim could be trying for that kind of progression. And again, if it takes a decade or two, that’s probably fine for a still-young leader expecting to be in power all his life.

The point is to stay in power, which is harder to do without weapons of mass destruction. Kim has considered the fates of two other strongmen for lessons on that, as reflected in an editorial published by state-run news agency KCNA in January:

“History proves that powerful nuclear deterrence serves as the strongest treasured sword for frustrating outsiders’ aggression… The Saddam Hussein regime in Iraq and the [Muammar] Gaddafi regime in Libya could not escape the fate of destruction after being deprived of their foundations for nuclear development and giving up nuclear programs of their own accord.”

Make Korea whole again

Another aim of Kim’s might sound unlikely from the outside, but reasonable if you’re expecting to be in power for many decades to come: the withdrawal of US forces from the Korean peninsula. B.R. Myers, an American author and professor at South Korea’s Dongseo University, argues it’s important to look at the long-stated goals of the Kim dynasty. In a February interview with Slate, he said:

“Were Kim Jong-un to share our own leader’s love of slogan caps, his would read: Make Korea Whole Again. Unification is not just central to the North’s ideology, but the only sure and lasting solution to its security problem. That makes the nuclear crisis all that more difficult to solve. But we will never get anywhere if we don’t face up to the true and frightening nature of the North’s goals.”

As Myers sees it, Kim wants treaties with both South Korea and the US. The treaty with the former would require South Korea “ending its ban on pro-North political agitation.” The one with Washington would entail removing American troops from the Korean Peninsula. After that would come some kind of North-South confederation, followed by eventual North Korean rule. The better North Korea’s weapons, the better leverage it has to achieve such goals.

Long-term strategic thinking of this sort might seem at odds with the view that the Kim regime is scrambling to survive in the face of tough words by Trump and ever harsher economic sanctions by the United Nations. But Thomas Wright, an analyst with the Lowy Institute in Sydney, also sees a broader plan at play:

Kim’s ambitions appear greater than mere survival. He is a young man who believes he will be in power for another 40 years. The ICBMs are the key to his long-term strategy. He seems to believe that ICBMs will fundamentally change the balance of power in the region by forcing the United States to withdraw from South Korea. Kim may be right.

Ultimately, of course, few if any outsiders know what Kim’s real endgame is. ”Anybody who tells you what North Korea wants is lying, or they’re guessing,” Jon Wolfsthal, a scholar in the nuclear policy program at the Carnegie Endowment for International Peace, recently told the New York Times (paywall).

And whatever plan Kim has might be doomed to fail, regardless. But there might be more of a plan, at least—with decades rather than years in mind—than many realize.