After Japan surrendered in World war two, Korea was divided into two parts, one ruled by the United States, and the other ruled by the Soviet Union. Eventually, two separate countries were established; North Korea and South Korea. One was communist, while the other was a democracy.
In 1950, North Korea invaded South Korea, and captured most of the country.
Troops from the United States and the United Nations pushed North Korean troops back, and invaded North Korea.
Chinese troops joined North Korean troops, helping them to fight the United States and South Korea.
Both sides were pushed back across the border, and the conflict turned into a stalemate, in which nothing was achieved by the fighting.
The Korean War never officially ended, because the two sides couldn't come to a compromise. However, an armistice was signed in 1953 to stop the fighting.