Something that occurred to me recently is that North Korea may be becoming more aggressive, and suicidal, because they have realized the current regime cannot remain in power and will inevitably collapse soon. So Kim Jong Un may envision going out with a bang, by becoming the banana republic regime that nuked and crippled or destroyed the United States.

Alternately, that they see public support of Kim Jong Un diminishing, and are sabre-rattling to rally public support against the U.S./Japan/South Korea, to rebuild their support.