that applies to the US too, they preserve their rule in the peninsula, had their presence till now in the form of bases and THAAD (that annoys China and we know). S. Korea is a prosperous country while N.Korea is more like a burden to China.The result was clear, China achieved her goal of pushing US away from her doorway, good enough for China but not for US. China fought a war with Vietnam in the late 1970's, should Vietnam thank China for not nuking Vietnam? your mind is so messed up in this regard.
a scenario where China "volunteer" successfully beating back the UN troops out from the entire peninsula appears only in someone wet dream.
Vietnam is a case example where Chinese troops shows just how suck they are during battle. mind to tell you that while the US lost the war in Vietnam it never losses a single major battle during the entirety of the Vietnam war.