The whole governing idea of North Korea's ruling elite (Kim family especially) is based on their ultimate goal that Korea should not be subject to influence/impact under any big powers. This ideology set that confronting course from day one since NK came into existence because in reality Korea is a small country and has no capability to escape big power's influence.

But they pursue that goal anyway regardless of geopolitical reality. Thus you have from Korea war to nuclear armament, all kinds of crazy stuff. North Korean are not crazy but they might have some miscalculation or misjudgment on international geopolitics. Most people in the world are just clueless.