The Chinese still hadn't got over the turmoil of the Cultural Revolution yet. Their military had absolutely nothing but sheer numbers -lousy logistics and minimal training vs battle hardened Vietnamese who had long since been prepared for a Chinese invasion,regardless of accepting plenty of Chinese aid vs the US the Vietnamese have and always will see China as their natural enemy.
Of course,making nice with China was our way out of the Vietnam war. We traded South Vietnam,Laos and Cambodia for trade with China and that is pretty much the bottom line on this matter. We didn't "lose" the Vietnam war,we decided that it was better to have political and economic ties with China than fight over SEA. Don't bitch at me for speaking the truth,Nixon and Kissenger are the ones who made that decision.
Furthermore,when it came to Cambodia/Kampuchea we opposed the Vietnamese and the communist gov't they set up after kicking out the KR. While we didn't support the KR directly - as China did - we most certainly assisted their allies,namely that worthless crook Sihanouk who helped the North Vietnamese infiltrate South Vietnam AND the KR take over his own country.