Upvote:1
The retreat from Hungnam was an aftermath of the Battle of the Chosin Reservoir. In that battle, the Chinese had lost 40%-50% of the 120,000 men they had committed to battle against 30,000 American Marines and infantry. By the time these forces reached Hungnam, they were joined by about 70,000 South Korean troops. So the combined "Allied" forces actually outnumbered the remaining Chinese.
Once the Chinese approached Hungnam, they faced a new problem. Per the wikipedia article:
Against the strong naval gun fire support provided by US Navy Task Force 90, the badly mauled 9th Army was in no shape to approach the Hungnam perimeter."
And American airpower had also been a factor in intensifying the Chinese losses on the move south. The greatest concentration of American planes in North Korea was at Hungnam.
The Chinese had accomplished their main goal of driving the American "spearhead" away from the Chinese border. They had no reason to take on the combination of American soldiers, South Koreans, ship artillery, and air forces available for city fighting where the numerically superior defenders also had the advantage of the protection of buildings.