All summer long, North Korea has tested one weapon after another, the most recent being a ballistic missile this Friday. And with each new act of belligerence, experts and the media have scrambled to make sense of what comes next. “What is North Korea Trying to Hit?” asked the Washington Post, while Bloomberg went straight for the gut-punch with “Scared About North Korea? You Aren’t Scared Enough.” For the more levelheaded readers (like Alaskans, the Americans who live within closest range of a North Korean missle, but are more concerned about bears and moose), the real question might be, why do North Koreans hate us so much? After all, the Korean War—as horrifically destructive as it was—ended more than 60 years ago. The United States hasn’t attacked North Korea once since that armistice was signed, but the little country has remained a belligerent—and since 2006, nuclear-armed—thorn in the world’s side.

Part of this perpetual aggression has to do with the personal experiences of North Korea’s founding father, dictator Kim Il-sung. Born in Japanese-occupied Korea in 1912, Kim Il-sung spent most of his childhood in China, eventually joining the Chinese Communist Party and leading a renowned band of guerrilla fighters that took on Japanese forces in northeast China and Korea (a region then called Manchuria). But when other members of the Chinese Communist Party accused Kim of conspiring with the Japanese, he learned that loyalty wasn’t always returned. In the 1930s, Kim also knew the Soviet Union was deporting ethnic Koreans from the Soviet Far East back to Korea, because the Soviets, too, feared Koreans would support Japan in the latter’s expansion across Asia. Even the countries that should have ostensibly been Kim’s allies from the start of his military career didn’t seem to have his home nation’s best interests at heart.

From there, things only got worse. Having joined the Soviet Red Army in 1940, Kim Il-sung was perfectly positioned for a fortuitous appointment—Stalin made him the head of the North Korean Temporary People’s Committee in 1946, and when North Korea officially became a country in 1948, Kim was declared its prime minister (at that point Russia and the U.S. had succeeded in defeating Japan and divided the Korean peninsula into two countries, with the border drawn so that the U.S. would administer over Seoul).

In 1950, Kim Il-sung convinced Soviet Premier Josef Stalin to provide tanks for a war that would reunify North and South Korea. Kim nearly succeeded, advancing his troops down to the southern edge of the peninsula to take almost the entirety of South Korea. But then American forces led by General Douglas MacArthur pushed the North Koreans all the way back up to their shared border with China. When Kim begged Stalin for help, the Soviet dictator said no. And Chairman Mao Zedong of China waited two days before agreeing to assist the North Koreans.

“Imagine how one would feel knowing that you lost your country for those two days,” says James Person, director of the Center for Korean History and Public Policy at the Wilson Center. “The historical experience and Kim’s own personal experience shaped the way that the Korean leadership saw the world”—as a hostile place with no reliable allies.

After three years of fighting, the war ended in 1953. Even then only an armistice was signed—not a formal peace agreement. A new border was drawn that gave South Korea slightly more territory and created the demilitarized zone, or DMZ, between the two nations. The U.S. continued assisting South Korea in its development, and China and the Soviet Union remained nominal allies of North Korea.

North Korea’s idiosyncratic foreign policy since then can be traced in the history of three words: juche, songun and byungjin. Each has taken its turn as a central tenet for every new Kim in the North Korean dynasty. Each has colored the totalitarian regime’s reaction to the rest of the world—and especially its relationship to the U.S.

Juche (Going It Alone)

In 1972, North Korea’s socialist constitution adopted “juche—a creative application of Marxism-Leninism—as the guideline for state activities,” according to Understanding North Korea, a publication of the South Korean government. Although the word is often translated as “self-reliance,” North Korea expert Jonathan Pollack, who works with the Brookings Institution, says that doesn’t capture the whole of it. “Juche is more what I would call ‘self-determination.’ It basically says you can beg, borrow and steal from anyone in the world, but you can still tell them to go f*** themselves,” Pollack says. “There’s a level at which they’ve been so audacious through all their history—don’t get me wrong—but you kind of have to admire it.”

For Kim Il-sung, juche was the result of not trusting either of North Korea’s nominal allies, the Soviet Union and China. He already felt betrayed by their lack of support during the Korean War, and his opinion didn’t improve during the Cold War. North Korea perceived the Soviets as having capitulated to the U.S. during the Cuban Missile Crisis in 1962, Person says, and his experiences in China made him wary of fully trusting Mao Zedong. So beginning in the early 1960s, the country threw an enormous amount of resources into developing its military. By 1965, North Korea’s budget for national defense rose to nearly 30 percent of its GDP, when it had only accounted for 4.3 percent of its GDP just nine years earlier, reports Atsuhito Isozaki.

Kim Il-sung continued to squeeze China, the Soviet Union and Eastern European Communist countries for all he could get, all the while keeping them at arm’s length. “No foreign country has retained a major presence in the North, other than in an advisory capacity,” Pollack says. But that mistrust of other countries and determination to forge their own path backfired when the Soviet Union collapsed at the end of the 20th century, and North Korea’s go-it-alone mentality was tested by a sudden decline in foreign aid. Shortly after that, in 1994, Kim Il-sung died, and the torch of leadership passed on to his son, Kim Jong-il.

Songun (Maintaining Power With Military Might)

Kim Jong-il inherited a country—but also a devastating economic recession and famine. Without the Soviet Union providing food aid and acting as willing trading partner , North Korea’s economy contracted by a quarter, Pollack says. Several million people died of starvation, though the exact number is unknown because the country is so secretive. But rather than invest in agricultural development, Kim Jong-il doubled down on his father’s policy of increased military spending, creating a new national ethos called songun, or “military first.”

“The military is not just an institution designed to perform the function of defending the country from external hostility,” writes researcher Han S. Park for the Korea Economic Institute of America. “Instead, it provides all of the other institutions of the government with legitimacy. [Under songun], no problem is too big or too small for the military to solve.”

In a country of only 24 million people, more than 1 million are active members of the military, and the institution has a compulsory 10-year service requirement. Not only do military personnel test weapons and train for battle, they’re also assigned more menial duties like carrying groceries for civilians and repairing plumbing. With the U.S. conducting annual military drills in South Korea to show its continued support of South Korea’s existence, Kim Jong-il’s military focus served to reinforce his false narrative: The country needed the military not only to survive the famine, but also to protect itself against the external threat of an aggressive U.S.

“They have a vested interest in maintaining the idea of an implacable American adversary,” Pollack says. “It enables him to explain why they’re backward: if it were not for the evil Americans, we would be x, y, and z economically advanced.”

Byungjin (Parallel Paths to Butter and Bombs)

After Kim Jong-il died in 2011, his son, Kim Jong-un, assumed office and quickly developed a new vision for the future of the country—byungjin, or “parallel paths.” The idea built on what had been established by his grandfather at the country’s origins, incorporating the ideas of both juche and songun. Introduced in 2013 as a major policy, it directed that North Korea’s economy would focus on manufacturing consumer goods and developing a nuclear deterrent.

“It’s not just about trying to get attention,” Person says of North Korea’s nascent nuclear program. “They are trying to demonstrate that they’re able to defend themselves, and they’re resisting regime change.” Kim Jong-un only needed to look at the outside world for examples of what happens when a country either stops pursuing or doesn’t fully develop a nuclear weapon program: Saddam Hussein was toppled in Iraq in 2006, and Muammar Qaddafi was killed in 2011. It doesn’t matter that North Korea isn’t entirely analogous to those countries, Person says; focusing on nuclear weapons continues to legitimize Kim Jong-un’s rule.

The manufacturing prong of byungjin indicates that unlike his father, Kim Jong-un may have also recognized that a nation of people can’t live on nuclear weapons alone. “[The isolationism] can’t go on forever,” Pollack says. “Unless North Korean leaders are content with remaining isolated and backward, there will be pressures that will erode the loyalty of central elites.”

But because North Korea has long defined its national policy in relation to the existential threat of external foes, when that happens is anyone’s guess. “They’ve had almost a 70-year history and they’re still standing,” Pollack adds. “I’m not going to hazard a prediction or presume they’re going to end soon.”