Sweden unwittingly executed a great strategic manoeuvre by surrendering all of Finland to Russia in that last war of theirs. That reduced Sweden's land border with Russia to a fraction of what it used to be. Later Finland became independent, which eliminated Sweden's Russian exposure completely. It's easier to maintain peace when you don't share a border with a chronically unstable aggressive empire.
It actually reduced the border with Russia to zero.
No, it didn't. It still had a considarable length of common border with the russian province Finland in Lappland. (To be honest, that was my first reaction too, but as the GP wrote, Sweden stopped to have a border with russia only after Finland became independent in WW1).
Well, they're doing something right, then.