Also helpful to collect intelligence.
Sending missiles toward Japan directly hurts the economy of Japan and its political stability (which in returns, has positive effects that the competitors of Japan can reap).
North Korea has been very useful to China. You could make either case: that China would come to NK's rescue [1], or that it would hasten its demise [2].
There is also the possibility that North Korea would nuke Beijing if it was on the brink of defeat and China didn't come to its aid. The distance between North Korea and Beijing is only a few hundred kilometers, after all, and though North Korea may not have China's sophisticated arsenal of missiles, it has enough functional short range and medium range ballistic missiles to wipe Beijing off the map. A kind of reverse NATO, if you will. China might be condemned to back North Korea, even if it doesn't want to, under threat of nuclear annihilation.
[1] https://www.foreignaffairs.com/articles/north-korea/2022-02-...
[2] https://www.foreignaffairs.com/articles/asia/2017-12-12/why-...
North Korea has few enough nukes that first strike to take them out is possible. But would likely require using nukes. China, and much of the world, would not be happy. Acceptable if war has broken out, not to start a war.
Could you expand on this? Perhaps naively, I would expect the US & allies to be able to bomb all NK military assets and topple the inferior government easily & quickly. It wouldn't be another guerilla ground war, we just want to destroy their military capabilities.
I guess there is still the concern that China would back NK, but I can't see what China benefits from that. A war with other superpowers to protect a poor, weak, unpredictable regime?