Why did the Korean War take place?

The USA went to war in Korea for three reasons. The first reason was the 'Domino theory' - China turned Communist in 1949 and Truman feared that the next 'domino' would be Japan. The second was to undermine Communism and protect the American way of life - in 1950 the American National Security Council recommended that America start 'rolling back' Communism. Thirdly, Truman realized the USA was in a competition for world domination with the USSR.