Towards the end of World War II in the Pacific theater, the Soviets declared war on Japan, as they had agreed to do with their allies the United States and Britain, and invaded Japanese held areas on the mainland of Asia. The Korean peninsula was one of the areas they drove into and as with other areas it was split into two areas of occupation by the Soviets and the Americans. This split was along the 38th parallel and as the cold war overtook other events the US backed South Korea and the Soviet backed North Korea quickly put there people into power and helped them to set up their states.
The North Korean leader was Kim Il Sung and he built a 135,000 strong Peoples Army which was equipped and trained by Russian military personnel. The South elected Dr. Syngman Rhee in 1948 as the first President of the Republic of Korea. He moved to suppress communist guerrillas and try to bring stability to the South.
In 1949 the communist armies of Chairman Mao rolled through China and forced the nationalist Chinese off the mainland to the Island of Taiwan and American politicians started to debate who lost China to the communist. Communism seemed to be on the march and American reluctance to commit forces to mainland China to support their preferred leader Dr. Chang Kai Sheik led the leaders of North Korea, The Soviet Union and Communist China to concluded that they could probably launch a surprise attack on South Korea with North Korean forces, and win a quick victory before the Western Democracies would react, if they reacted at all.
On June 25, 1950 the North Koreans poured across the boarder into South Korea with 10 Soviet equipped Divisions. With an overwhelming advantage in tanks and artillery the North captures the capital of South Korea, Seoul, on June 27th and continued to race south. The US sponsored a resolution in the United Nations to resist the naked aggression of North Korea. The Soviet Union, which had decided to boycott the UN to protest various other issues was not present when the US choose to introduce the resolution and hence was not able to veto the action. This proved to be the deciding issue of the conflict as the United Nations proceeded to vote for a UN military force which would be sent to Korea to combat the aggressive Communist forces.
The US quickly committed troops to South Korea from its Japanese occupational forces in the form of the 24th division which was soon joined by the 1st Cavalry and the 25th Infantry Division. These under strength, unready forces were quickly driven back to a defensive perimeter behind the Naktong River in the southeast corner of Korea with the city of Pusan as the base of the position.