Communism played a critical role in global politics during the 20th century. After WWII, the "superpowers" (US and Soviet Union) entered into a time period of competition for influence around the world. The threat of the Soviet Union spreading its influence to other parts of the world led the US into several conflicts in many countries. Communist China also concerned the US, as it was trying to enforce its foreign policy of CONTAINMENT.
The US fought communism first by helping Western Europe recover from WWII through policies like the Truman Doctrine and the Marshall Plan, which gave military and economic aid to countries threatened by communism. The US also airlifted supplies to West Berlin to combat the blockade on the city during Stalin's attempt to control Berlin and Germany.
In the 1950's the threat of communism spreading to South Korea forced the United Nations to take its first military action led by American General Douglas MacArthur. In Korea, the UN forces (made up of about 80% U.S. troops) successfully drove the communist North Koreans out of South Korea. However, MacArthur continued into North Korea which caused communist China to join the fight and prolong the conflict.
A similar problem developed in Vietnam beginning in the early 1960's and into the 1970's when the U.S. committed to defending South Vietnam against communist aggression. However, the outcome of this conflict yielded very different results. The U.S. was unable to defeat the guerrilla fighters in South Vietnam and eventually had to withdraw. After the US forces withdrew from Vietnam, North Vietnam captured South Vietnam spreading communism.
The threat of communism declined at the end of the 20th century with the fall of the Soviet Union in 1989.
Communism affected global politics in the 20th century largely because communism made the Cold War possible. Communism also helped to affect the specific ways in which WWII played out.
The existence of communism helped WWII play out the way it did. Hitler knew that the West was very suspicious of the Soviet Union. He thought that this would help keep the West on his side. It made him think that the UK and the US, for example, should be his allies in a fight against communism. It is also part of what made him attack the Soviet Union. Thus, without communism, WWII might have been very different.
After WWII, communism completely shaped world politics. Without communism, it is likely that there would have been no Cold War. The Soviet Union would not have been trying to spread its ideology around the world. The US would not have been committed to containment. If Vietnam tried to gain independence from France, the US would probably have supported it for anti-imperialistic reasons rather than supporting France for anti-communist reasons. The US would not have supported dictatorships and unsavory regimes like the apartheid government of South Africa if it had not feared communism. In this way, communism (and the West’s opposition to that ideology) was the dominant force in the geopolitics of the last half of the 20th century.