NATO (North Atlantic Treaty Organisation) was (is) a treaty of collective defence of Western powers, with the USA being a key member. The Treaty declares that any attack on a member of NATO is deemed an attack on all countries of NATO and thus justifies defensive retaliation. The primary cause of its formation was the Berlin Blockade of 1948 which showed the threat of Soviet expansion into Western zones.
The Warsaw Pact was the Soviet bloc's equivalent of NATO but it was not formed until 1955. This suggests that it was only when Western Germany joined NATO in 1955 that the Soviets felt threatened and in need of their own defensive alliance.
These alliances demonstrate the rise in tensions between the two superpowers and the desire for collective security in line with the USA's policy of containment and the USSR's desire for a buffer zone.