When your elite soldiers, the face you show the world, are starving and infested with parasites you've got a pretty serious problem.
In the event of war, with massive use of modern smart weapons, it would take the US but a few days to smash just about everything in North Korea that looked nuclear or militarily useful, while US special forces would seal up or dig Kim out of whatever rat hole he had hunkered down in. The few NORK nuclear warheads would be destroyed in place and do nothing to avert North Korea's destruction.
Kim's turnabout can be traced to last year when North Korean hackers got a copy of an old US/South Korean war plan. Its detail as to the relative forces and capabilities was deeply unsettling and was confirmed by China. Unwittingly, Kim has fallen into the trap of acquiring enough nuclear capability to be worth destroying, but with not yet enough capability to be secure against his adversaries. His best option is to do as China commands: declare victory, denuclearize, and open up his economy.
In contrast, more clever rogue states like Iran aim to develop a nuclear breakout capability in which they have the materials and technology to rapidly go nuclear at a time of their choosing with enough warheads and delivery systems to destroy their adversaries. Fortunately, North Korea lacked the capacity to do that.