During the cold war the US and Russia both had nuclear weapons because If one side decided to attack the other it was ensured that the other would see equal or even more destruction. Basically the mutually assured destruction or MAD deterred people from attacking because they knew they would be destroyed aswell in turn. Preventing military conflict by the mutual understanding that if you provoke or attack us it wont be to far away from us attacking you back