Why did China enter the Korean War?
Mao motioned it, General Peng seconded, and all approved.
Before Mao motioned it, nobody would think it could happen, not Stalin, Truman, or MacArthur.
China just walked out of a Hundred Years of Humiliation. China was weak, poor, and racked by 17 years of wars. The US was willing to help Chiang to retake Mainland. The US sent the Seventh Fleet to the Strait, and MacArthur intruded on the border of China from Korea.
China sacrificed huge during WWII; however, as the winning country, it did not get any compensation from Japan which had invaded China and surrendered in 1945. If China had not entered the Korean War, the US might invade China from Korea, as Northeast China was the sphere of the USSR by the Yalta agreement. The US had a grievance that the US sphere of China was lost. The US might well enter Northeast China as a retaliation to Stalin. Mao was not in the picture yet. It might just be a war between Russia and the USA like the Russian-Japanese War in 1905.
China was independent in 1949 by claiming back the sphere of the USA in China. By entering the Korean War, China claimed back the sphere of Russia in China, Northeast China. Stalin recognized Chiang instead of Mao in the Cairo meeting and Yalta talk. Only after the Korean War Stalin recognized Mao and gave up the sphere of Northeast China.
The entering of the Korean War is very vital for New China to survive. Mao not only claimed back the sphere of the US by civil war but also claimed back the sphere of Russia through the Korean War. After the Korean War, the Russian navy withdrew from Lüshunkou District and China becomes really independent. Northeast China became free of outside threats that strengthened the sovereignty of China in that region. It was vital for China. Northeast China is the only prize China gets from winning the Anti-Japanese War as there was some industry infrastructure there to begin Chinese industry development. By beating the USA in the Korean War, Mao got a good bargain from Stalin who sent specialists to help China build heavy industry.
Some Western companies, such as HSBC, withdrew from Shanghai only after the Korean War. Korean War showed the world that Red China was real. China chose Russia and the cold war begin. China through the Korean War laid the cornerstone for Red China and changed the world order.