Seoul, South Korea — Threatening to fire a volley of missiles toward a major U.S. military hub — and the home to 160,000 American civilians — may seem like a pretty bad move for a country that is seriously outgunned and has an awful lot to lose.

But pushing the envelope, or just threatening to do so, is what North Korea does best.

By announcing a plan to send four “Hwasong-12” intermediate range missiles over Japan and into waters near the Pacific island of Guam, Pyongyang has significantly upped the ante despite threats from President Donald Trump.

The North has made it clear Kim Jong Un still has to sign off on the plan and give the execution order. But it says it could be ready to go within days — or just before the U.S. and South Korea are set to begin their annual Ulchi-Freedom Guardian military maneuvers.

So what, ultimately, is Pyongyang trying to accomplish?

A lot of things, actually.

First, build up the cred

North Korea sees the United States as an existential threat.

It knows that if it is going to be taken seriously, it needs to have a credible military deterrent. Its strategy for years, if not decades, has been to attain that by building long-range missiles that can carry nuclear warheads to targets on the U.S. mainland. It’s not good enough just to claim to have that capability — it must be demonstrated.

Successful tests provide the data needed to make technical advances and valuable training for ground troops. They also dispel doubts about whether those advances are being made.

Provocative testing or training also is a way of gauging where Washington’s red lines are. That can be used to decide when to push more aggressively or when to ease off.

Second, claim a new norm

North Korea has said many times it has no intention of giving up its nuclear weapons. It doesn’t want to use them as a bargaining chip — or in a war it could not possibly survive. It wants them as a status-booster.

Pyongyang wants to force the United States to accept that it is a nuclear power, as it did with Pakistan and India, and treat it with commensurate respect. But while there is little remaining doubt about North Korea’s nuclear capabilities, the U.S. has not accepted it as a nuclear power and is not likely to do so any time soon.

Pyongyang continues to push Washington’s buttons in hopes of changing that attitude.

Third, use the leverage

Though Trump is taking a very hard-line approach, at least in his rhetoric, growing concerns over Kim Jong Un’s accelerated missile launches have added strength to the camp in the United States calling for a diplomatic resolution. That would likely involve some “carrots” — compromises that would be attractive in North Korea’s eyes. This is Pyongyang’s potential payoff.

Just forcing the U.S. to talk would in itself be a success for North Korea. Especially if it gives the appearance of talks between equals.

Of course, pushing the envelope with moves like the potential missile volley toward Guam has a lot of risks. One or more of the launches could fail. And if a missile actually hit the island, the consequences could be catastrophic. But having merely floated the idea sets a sort of precedent the North can use as a new baseline. And if it goes through with the launch and there are no consequences, it can use that too.

Finally, push for what you want

What North Korea wants most is security. Its regime wants to survive.

It wants assurances it won’t be attacked, or suffocated by economic sanctions.

It wants a peace treaty formally replacing the armistice that ended the shooting war phase of the 1950-1953 Korean War. Getting any of those things would require a sea change in relations with not only Washington, but also Beijing, Seoul, Tokyo and possibly Moscow.

The good news, for everyone involved, is that North Korea isn’t likely to get what it really wants by starting another war.

But the bad news is that it’s not at all clear the North’s actions will help it achieve its goals. Indeed, they’ve helped create a risky situation that could spiral into something nobody wants.