Hello!
Since North Korea had invaded South Korea, the United States came to help South Korea, thus a counter-offensive by US troops was given. EE.UU and other nations under the UN mandate, which returned North Korean troops north of the 38th parallel, almost to the Yalu River.
I hope this helps you. Greetings.