That's not how Sweden remained "neutral" though, although I'm not sure I'd agree Sweden been neutral since 1814, wasn't exactly neutral before/during the second world war. https://en.wikipedia.org/wiki/Sweden_during_World_War_II
in your link there are numerous indications that Sweden keeps its military strong enough that it isn't worth fucking with, as in this quote
>Georg Homin, a captain on the General Staff, stated:
> Without a defensive force we cannot follow any policy of our own, our declarations become merely empty words and we leave the country's fate to chance, or to the decisions of others. With a defense as strong as Swedish conditions allow, we secure for ourselves the basis of a continued independent Swedish policy.
obviously strong enough that not worth fucking with is a relative thing, based on a calculation of what do you get for attacking, how much will you have to spend to get that?