Luck and Stanislav Petrov, amongst other reasons. Which is utterly terrifying. I still find it amazing that Stanislav Petrov was fired from his job a few days after averting nuclear Armageddon, I think he was chiefly because he didn't follow protocol. Even though his actions prevented Thermonuclear war.
I also don't imagine there was much of a Unfair Dismissals Tribunal type arrangement for nuclear weapons officers in the USSR.
ETA: DragonDictate can't spell thermonuclear