Last May, Time published an article about North Korea's food situation. Contra the lede, closer to 2 million people died during the famine of the 1990s, almost ten percent of the total population. Their food production ability hasn't improved much since then. I can report anecdotally that every winter, small villages are on their own, getting no help from the central government. A lot of people die from starvation.
And as the above-referenced article says, it was just a year ago that several organizations were predicting another round of mass starvation deaths. Every aspect of that nation is in shambles. There is very little electricity, even running water. Enormous stands of trees have been stripped of bark used as human food. The entire nation faces chronic shortages of medical supplies.
North Korea is in every way possible a failed state. They can't feed themselves, can't support industry, can't provide medical care. The central government is concerned only with maintaining itself and its military, and has failed so completely that it can't even accomplish that. North Korea is run by an erratic, power-mad dictatorship that finds itself dependent upon the nations it demonizes in order to survive.
That's the proper context for viewing North Korea's recent nuclear and missile tests. I've said this before, but it bears repeating because people insist upon considering them to be an existential threat, when they are nothing of the sort. They're not going to attack China or Russia because those countries are almost as crazy as they are. They're not going to attack South Korea with unconventional weapons because they'd just destroy themselves, and they're not capable of waging a conventional war with South Korea. Every male over the age of 21 has either served in the South Korean military or is currently doing so. They're better equipped, better trained and healthier - and there's around 30,000 US soldiers in South Korea as well, with the promise of swift, brutal retaliation if anything happened to them.
We need to worry about North Korea selling its nuclear technology, but that's the same worry we have about all sorts of nations, and the former Soviet Bloc has a lot more nukes distributed among nations that are, at best, only marginally more stable than North Korea. Nort Korea is part of a problem, not the problem itself.
North Korea is simply hungry and in need of grist for its domestic propaganda mills. It's highly dysfunctional, but give them what they want and they'll calm down. Short of invasion, it's the best we can do.