Prewar situation
Before the Korean War, the Korean Peninsula was divided into North and South Korea, just as it is today. However, the border between the two countries was the 38th Parallel. This was created when the Allies defeated Japan in World War II and took Korea away from Japan to govern for themselves. The 38th parallel was an arbitrarily chosen line, without thought for the geographic, political, and cultural sections in the region. It did make for an even-looking map of Korea, though.
The Korean Peninsula was split between the USSR, which controlled North Korea (formally the Democratic People's Republic of Korea or DPRK) and spread communism there, and the US, which controlled South Korea and made it anti-communist. When the two major powers withdrew in 1949, they left behind two Korean governments - a strong, aggressive communist regime in the north and a militarily weak dictatorship in the south.
War Erupts
Wishing to unify the entirety of Korea, the DPRK invaded South Korea with its army on June 25, 1950. This military force, called the North Korean Peoples' Army, was created with the help of the USSR back when it controlled North Korea, and was therefore armed with Soviet tanks, artillery, and other equipment. South Korea's military, on the other hand, was weak and had no tanks and barely any artillery. This meant that North Korea's invasion met little resistance as the tanks rumbled further and further south, capturing the South Korean capital, Seoul, and closing in on the vital port of Pusan.