The Korean war spanned from June 25, 1950 to July 27, 1953. In 1945, by the end of World War II, Korea was freed from Japanese control. Syngman Rhee ruled the capitalist South Korea while Kim Il-Sung ruled the communist North Korea. By 1948, the country was divided in half along the 38th parallel, with American troops occupying the south and Soviet troops occupying the north half. By the time Soviet and American troops withdrew from Korea, tensions were high enough that the border would not hold.
On June 25th, 1950, North Korea invaded South Korea, advancing across the 38th parallel. The North Korean People's Army easily defeated the Republic of Korea's army, captured the capitol, Seoul, and proceeded to occupy all of South Korea except for Pusan.
The United States joined the Korean War because President Truman wanted to contain the spread of communism. The United States was worried about the Domino Effect. The theory was that if Korea fell to the ideology of communism, so would all surrounding countries. On principle, the Korean War was seen as a threat to America and American values.
When South Korea appealed for support, the United States pushed a resolution through the United States Security Council.