The People's Liberation Army is massed along the Yalu and Tumen Rivers on the DPRK border. If it appears the North Koreans will be defeated, and ROK forces move north, the Chinese will act decisively just as they did in November of 1950. Let there be no doubt about that. And this time the Chinese will not be throwing flesh against steel.
Yes, you are right that Chinese forces are massed on that border, but I have explained 2 times in this thread that they are there because NK might go crazy and attack them. The Russians aren't so trusting either as they have similar amounts of troops massed in the NK-Russian border too. You might think that they are there to help NK, but given Wikileak's documentation about China's attitude to NK and that China and Russia has so much to lose politically, economically, diplomatically and morally, casts doubt whether China and Russia will help.
1) Political damages: The country leadership would look bad to its own citizens, not to mention international condemnation, which would severely affect the country’s leadership’s political power
2) Economical damages: Helping NK in case of war would result not only in severe backlash, but the high possibility of sanctions, which would affect both nations severely as both Russia’s natural resource-driven and China’s export-driven economies depend heavily on imports and exports. Undoubtedly, there would be much economical damages
3) Diplomatic damages: They would lose face in international worldview, not only losing their credibility (which both nations are in dire need of), but their bargaining chips as they would be shown as weak supporting NK
4) Morale damages: Most citizens of both countries are very decent and know much about NK-SK situation. If they find out that their country is supporting NK, then the morale base of the country would be destabilized (Note: I am aware that China publically supports NK, but in case of war, well, the citizens would see enough)
I went back to my records and will give the chronology of key events
1945: Separation of NK and SK
1946: NK's communist party (Korean's Worker's Party KWP) inaugurated. Kim-Il-Sung installed as head
1948: Democratic People's Republic of Korea proclaimed (NK) Soviet troops withdraw
1950: Korean War (6.25 war as called in Korea as it began in the 6th month, 25 th day) begins
1953: Armistice temporarily ends Korean War, costs millions of lives
1980: Kim-Jong-Il moves up party ladder
1991: NK, SK joins UN
1992: NK agrees to inspections by International Atomic Energy Agency (IAEA), but over next two years refuses access to sites of suspected nuclear weapons production
1994: Death of Kim-Il-Sung. Kim-Jong-Il comes at leader, but doesn't get presidential title (the dead Kim-Il-Sung still has it). NK agrees to freeze nuclear programme in return for 5 billion dollars worth of free fuel and two nuclear reactors
2000: Summit and general thawing of relations as Kim-Jong-Il and Kim-Dae-Jung meet
2002: Bush gives "axis of evil" status to NK
2003: Nuclear tensions. US claims NK admitted to nukes, stopped oil shipments to NK. In November, NK reactivates Yongbyon reactor, inspectors thrown out
2003 January: NK withdraws from Nuclear Non-Proliferation Treaty (NPT)
2003 April: NK, US, China begin discussions in Beijing, first discussion since start of nuclear crisis
2003 July: NK claims has enough plutonium to make bombs
2003 August: Six-party talks in Beijing begins, but fail to bridge diplomatic gap
2004: Third round of six-party talks ends, NK pulls out scheduled September round
2005 Feburuary: NK claims built nukes for self-defense
2005 September: Fourth round of six-party talks concludes. Nk gives up weapons in return for aid and security guarantees, later demands civilian nuclear reactor
2006 July: Nk fires long range missiles, several medium-range missiles, starts international outcry. Although the Taepodong-2 is said to hit US, US claims it crashes shortly after take-off
2006 October: NK claims to test nuclear weapon for the first time
2007 February: Six-party talks resume on Beijing. On last minute, NK agrees to close main nuclear reactor in exchange for fuel aid
2007 October: Nk commits to disable three nuclear facilities and all of its nuclear program by year-end
2008 February: Lee-Myung-Bak inaugurated as SK president, takes hard-line stance against NK
2008 March-April: NK-SK relations deteriorate sharply. NK expels SK managers in Kaesung industrial park, test fires short-range missiles and accuse MB (Lee-Myung-Back) of sending SK warships in Northern waters
2008 June: NK makes declaration of its nuclear assets
2008 July: NK soldiers shoot SK woman in Mount Kumgang special tourism area
2008 October: US removes NK from list of countries sponsoring terrorists. NK provides full access to nuclear sites
2008 December: NK slows down denuclearization as US suspends energy aid. US's suspension came as breakdown of talks
2009 April: NK launches supposed "satellite" but many suspect testing of long-range missile technology. After much criticism, NK walks out of six-party talks
2009 May: NK claims to have successfully carried out second underground nuclear test, draws protests from US AND CHINA ALONG WITH RUSSIA. (Emphasis on capitalized words). NK also announces it no longer recognizes armistice
2009 June: NK proposes reopening talks about Kaesong industrial park. Kim-Jong-Il’s eldest son Kim-Jong-Nam confirms reports and speculations about the third son Kim-Jong-Un succeeding power
2009 October: NK indicates willingness to resume bilateral and multilateral talks after Kim-Jong-Il meets with Chinese premier Wen-Jiabao
2010 January: NK fires artillery into disputed maritime border (this is not the Yeonpyong incident). SK returns fire
2010 March: NK sinks the SK frigate Cheonan, killing 46 sailors
2010 mid-year: Rapid steps made by NK to ensure Kim-Jong-Un’s succession
2010 October: NK fires artillery into Yeonpyong island killing 2 civilians and 2 marines.