A mystery has long surrounded North Korea’s nuclear and missile programs.

Conventional wisdom holds that the North’s weapons are intended to address the country’s two greatest problems — military inferiority and economic weakness — by deterring the United States and extracting concessions.

But in practice, the weapons make both problems worse by increasing the risk of war and ensuring continued sanctions.

So what is driving the North’s actions? Earlier assessments pegged the country as irrational or warped by its own ideology. But virtually every expert now dismisses those explanations, saying that North Korea has managed its history-defying survival too cannily to be anything but coldly rational.

And with each test, most recently the launching on Friday of a missile that according to some estimates could strike most of the United States, the contours of a far more ambitious strategy grow clearer.