Why did China get involved in the Korean War?

A civil war broke out on the Korean Peninsula on June 25, 1950. China regarded the war as an internal Korean affair, but the U.S. seized the opportunity to move its 7th Fleet to prevent the liberation of Taiwan by the Chinese Liberation Army Evidently, the move was part of the U.S. strategy of isolating and surrounding China. This part of CGTN's documentary "Enemy on the doorstep: China's involvement in the Korean War" explains the reason why China got involved in the Korean War.