World peace at that time depended on a fragile balance of armaments and the knowledge by both the USA and the USSR that the actual USE of their nuclear weapons would result in "MAD" - Mutually Assured Destruction.
As a power move, the USSR persuaded to allow Soviet missile-carrying craft to be based in Cuba, so near to the US that US cities were within easy reach of a warhead. This would have changed the balance of armaments well over toward the USSR, had JFK not taken the initiative and insisted on their withdrawal, and faced it off. It was a scary time, as it could have become an armed fight, had it not succeeded - but if he had not done so, the USSR would have been in a position to dominate the rest of the world.