The Korean War, framed in the global context of the Cold War, was a war between the two newly created factions of North Korea, communist and supported by the USSR and China, and South Korea, democratic and supported by the United States and the western block.
This war began in 1950, when after months of tension the North attacked and took over much of South Korea. But the United States jumped in and pushed the North Koreans back to the Chinese border. Then China got involved and pushed the Americans and South Koreans back.
The communist forces took the democratics to the extreme south of the Korean peninsula, where after the battle of Incheon the latter began an advance to the north. This advance ended at the 38th parallel, where the war turned into a trench warfare without noticeable territorial movements.
This situation lasted until 1953, when a ceasefire was signed between the two Koreas. This ceasefire implied the constitution of two independent nations among themselves: North Korea and South Korea.