Why were we committed to the Civil War in Korea and not to the one in China?
There are at least three major reasons why this would have been the case.
First, we have to realize that the Civil War in China might well have been unwinnable given the amount of resources that the US could possibly have allocated to that war. The Chinese nationalists were not particularly strong when compared to the communists. China is a huge country. The US would have had to commit huge numbers of troops, right after the end of WWII, to try to keep China from becoming communist. Therefore, the US might well have decided that it could not possibly win in China. By contrast, the war in Korea was much more winnable.
Second, the war in Korea was the clear result of aggression. South Korea was a separate country that was invaded by North Korea. This was different from the situation in China where it was a civil war with neither side being a clear aggressor. The US was much more clearly “in the right” in Korea.
Finally, the war in Korea happened in 1950 while the civil war in China had lasted all through WWII and simply kept going after the Japanese were ousted. By 1950, communism seemed like much more of a threat than it had been in 1945. This made the US more committed to that conflict.
For these reasons, the US was willing to fight hard in Korea where it was not willing to truly get involved in China.