The Korean War broke out as a result of post-World War II geography. At the end of the Second World War the, U.S and Soviet Union had driven the Japanese out of the Korean Peninsula. The U.S. set up a pro-democracy government in the south while the USSR helped install a communist government in the north effectively dividing the peninsula in half.
In 1950 the north invaded the south in an attempt to unify the peninsula under a single communist regime. Recent documents have uncovered that this was helped put into motion by the U.S.S.R. in an attempt to expand geopolitical influence in Asia. The U.S., who at the time had taken a hard-line stance against communist aggression in the form of the Truman Doctrine, rallied the UN to the support of the South Koreans and thus entered what was known as the Korean War. The UN backed forced of the south succeeded in counter-attacking all the way to into the North, but Chinese military units pushed the coalition back until a stalemate developed near the current boarder and an armistice, but not peace, as declared.
So, the causes of the Korean War could best be summed up as post-World War II geography, communist aggression and a reactionary western alliance.