It's not amazing, it's textbook totalitarianism with a sprinkle of authoritarianism. They have plenty of resources, it just goes to the government with a small amount going to the elite (a small minority of citizens in Pyongyang). His papa lived like Henry the VIII. China openly supports them with resources and defends them against the vast majority of U.N problems. The rest of their money comes from farming and mining (which, believe it or not, the military does a lot of..makes it certain it all goes to the "haves" and not the "have nots".), and from the black market. It's less data selling and more drug trade, counterfeiting and exporting from their garment industry.
Regarding the weapons, well, the truth is somewhere between giving them too much credit and not giving them enough. While it's true that they've had far more failures than success and are worse at Photoshop than Iran, they shouldn't be laughed at. Why? Because they keep trying. It's a weird situation with them, they make serious threats and the surrounding nations are at serious risk, but they tend to be at their most aggressive when they are so short on life-sustaining resources that their power becomes threatened. Knocking them out of power would be wonderful, but not at the expense of almost 30 million completely innocent citizens. So, we keep them on the chessboard until a better way comes along or the citizens just get sick of it..which has been happening for the last several years. Their power is waning, but no one knows who would take the place of the "dear leader" without going right back to being a dictator again. And, worse, guys like this tend to resort to even more drastic measures to hold on to that power when they see it slipping. Assad is a great example of that.