1. NK's economy is in shambles. The regime has almost nothing to lose.
2. NK's regime does not care about human life (as evidenced by abuses against the people of NK). They would have no qualms about killing many many foreign civilians.
3. NK's populace/military would either not know about such an attack, would be convinced by state media that it was a justified attack on a military target, or would not be in a position to do anything about it.
4. Every country which NK has threatened (US, Japan, SK) is in all ways the opposite of the above: economically robust; government/military respecting of human life (of course there is room for debate there); populace respecting of human life and wary of war.
That means that any attack from NK against one of the above countries plays out as follows:
1. NK obliterates a population center. It has now demonstrated a capable threat.
2. NK makes demands (food, money, land, autonomy, whatever).
3. Victim country (say Japan) can either retaliate with precision strikes, retaliate in kind, retaliate with massive force, do nothing, or give in to demands.
3.a. Retaliating with precision strikes takes too long. NK launches another devastating attack. It is clearly not an option for the victim to lose another population center.
3.b. Retaliating in kind would be unacceptable to the government and populace of the victim country and the world at large. And if it were, it would not be worth the chance of a second attack from NK.
3.c. Retaliating with massive force (the "Trump" option) is absolutely not an option. Like the previous response, it would be completely unacceptable to the rest of the world, but most importantly, you would now be in a war with China who has to contend with a flood of refugees from a destroyed country.
3.d. Do nothing. Another city gets destroyed. NK is desperate, and there are lots of cities it can blow up until it gets its way.
3.e. Give in to demands. This is the only outcome that is all-around tenable. NK is happy, and further massive loss of human life is prevented.
NK is in an even better position if they can win their demands by merely demonstrating capability of destroying – or accidentally destroying – a city (e.g. by launching missiles over Japan), because they can repeat that trick more frequently than by actually destroying a city.