It started when the North Korean communist army crossed the 38th parallel and invaded South Korea. The US then jumped in to provide aid to South Korea.
In July 27,1953 North Korea and South Korea and the other allies involved were supposed to sign an agreement, but South Korea did not want to sign so they created another agreement.