Some factors leading to the Korean War:
Kim Il Sung, totalitarian dictator of North Korea (N.K.), originated the idea of invading South Korea (S.K.) and had some Russian military advisors who were stationed in Pyongyang, draw up a plan. Kim believed that the U.S. would not help the Rhee government in S.K. and that even if they did, he could win his war before they arrived. He was also encouraged by the fact that there were some communist guerrillas in S.K. who would rally to his aid when he invaded.
In 1949, Mao of China told N.K. diplomats that he supported N.K.’s plan for communist expansion but that he could not provide troops to help before his Chinese communists had a secure hold of all of China. Only after N.K. had lost its war and pleaded for help, did Mao send troops into Korea. At that, it was more MacArthur’s strategy than pleading from Pyongyang and Moscow, that brought China into the war. MacArthur had pushed his United Nations (U.N.) forces right up to the Chinese border, though China had warned him not to. Chinese Manchuria bordered Korea and was a vital industrial region of China. China was afraid that either U.N. forces would invade Manchuria, or Russian forces would invade Manchuria in order to "protect" it from the U.N. forces. Also, before Japan had annexed Korea, Korea had for a long time been a loyal tributary state of China, so it would look bad if China did not come to the aid of its fellow communist state of N.K. to repel the U.N. invaders from its soil.
Only after a series of pleas from Kim Il Sung, did Stalin of the U.S.S.R. give a hesitant approval for Kim’s invasion of S.K. Stalin gave this approval after negotiating a mutual defense treaty with China in which negotiations did not go as he had hoped. He had asked Mao for several concessions that would have permitted some U.S.S.R. forces to remain at a few locations in China. Mao wanted China to be completely independent of the U.S.S.R., so he refused. Stalin decided Mao was not going to be as easy to get along with as he had hoped. Ever since the end of World War II, N.K. had been a U.S.S.R. satellite state. Stalin now decided that a reunified Korea under Russian influence might be a good counter-poise to China. Not only to China, but also to the strong American presence in Japan. He figured that if Korea was reunited under U.S.S.R. influence, the U.S. would transfer troops from Europe to Japan and he thought this would be good for Russia (to get the U.S. troops away from U.S.S.R.’s satellite states in Europe) and bad for China. Stalin was also optimistic because of communist guerrillas in S.K. and because the Rhee government in S.K. had become unpopular. The U.S.S.R. would appear weak in the eyes of the world if it did not aid its satellite state, N.K.
The U.S. had committed itself to helping S.K. become a nation-state. The largest number of U.S. civilian and military advisors anywhere in the world was in S.K. U.S. policy-makers believed that a loss of its client state of S.K., would mean a loss of U.S. prestige all around the world.
Jo, Yunghwan. 1991. "The Soviet and Chinese Roles in Initiating the Korean War, and Its Link to the Origins of the Sino-Soviet Dispute" in Chullbaum Kim, ed., The Truth about the Korean War: Testimony 40 Years Later. The Eulyoo Publishing Co., Seoul, Korea.
Lee, Steven Hugh. 2001. The Korean War. Longman, 33-34.
The main factor that led to the Korean War was the Cold War -- the struggle between communism and democracy. This was the major reason why North Korea wanted to invade South Korea.
The reason that North and South Korea were divided comes from WWII. In that war, Japan occupied Korea. When the war was ending, Russian troops occupied the northern part of Korea so it became communist while US troops occupied the South, which became non-communist.
A major immediate cause of the war was a speech given by the US Secretary of State, Dean Acheson, in which he seemed to imply that the US would not defend South Korea from communist aggression.