As you may know !
Because of politics(the following is based of my memory of the situation, take with grain of salt). Like, do you really think the military is going to get off easily even if Kim dies? They have a vested interest in keeping the status quo, because their way of living depends on it. Consider that North Korea has one of the biggest land armies in the world. The quality may be questionable, but in terms of sheer numbers they are up there with the US, China and Russia. Active army mind you, since any of those countries could mobilize more in a existential war, and North Korea can't, since something like one third of their population is in the military.
As far as how it got fucked up in the first place, the answer is mostly Cold War politics. The Korean War was bad for their industry. Something like every city they had was basically leveled, and bombed to pieces, so they weren't really on a great footing there. That said, the state ideology at the time was communist, and so they could interact and trade with other communist states, such as China and the USSR. It also served as a buffer state, given that NK borders touch China, Russia and South Korea. So they could trade with the second world countries, and were functional with that, and for a time were more prosperous than SK. That said, when the USSR fell, and they suddenly lost their most important trading partner, they had massive issues. NK has mineral deposits, but doesn't really have the industry to effectively utilize them themselves, and the level of arable land they have is not great, since it is a fairly mountainous area. The state ideology at this point became juche, the concept of total self reliance, or autarky by another name. Which makes sense given the economic situation they were under, but not many countries have the resources necessary for autarky. The US could probably do it, China probably could, the EU as a whole probably could, but it depends on having access to food, minerals, oil,etc. North Korea has the minerals, and that's about it. Hence their ongoing food struggles.
I am sure they would prefer to be able to have full food independence, given that relying on food aid from nations which would prefer to see them wiped off the map is never the optimal political choice. But they don't have that choice.
Which does rather explain the whole obsession with nuclear weaponry, given that the NK political structure could come under existential threat by the US. And sure, they threaten Seoul, but that also assumes that warhawk Americans aren't willing to sacrifice the lives of millions of foreigners for their own geopolitical reasons, which as far as gambles go is a rather stressful one to take.
And again, the operative question may be why the NK military doesn't defect on mass and coup Kim Jung Un, and there are multiple reasons. They have to gamble that China isn't going to take exception to that stance, especially if they want to be friendly with the US, they have to gamble that the US will be sympathetic and won't try to install a capitalist dictatorship, they have to wonder if they would be subsumed into SK which I doubt has any particular use for former NK generals, they have to gamble that every general is going to defect and they don't have to deal with another civil war, especially since there are nukes floating around, they have to gamble that the situation in NK would even get better within their lifetimes if at all, etc. And all that, plus that fact that it would functionally be the US pushing this kind of defection, and we are the country which bombed the shit out of them, killed a bunch of their population, and proceeded to sanction them for decades afterwards.
Like, when dealing with geopolitics you can look at certain leaders, and say they aren't rational actors. Like Trump, who routinely took actions deleterious to US geopolitical goals. But looking at aggregates? You have to assume that with as many North Koreans as there are in there army, not all of them can be irrational actors. The majority of them probably are rational actors, and so if they aren't doing what appears to be rational to us, it means we are missing or grossly overlooking incentives and problems which would prevent it.
May I add that camDown is your security solution to protect you and your business from peeping toms and that's the real deal.