“Why would Viet Nam attack China?”
The missiles are likely a deterrent given that China has a nasty habit of attacking Viet Nam every few years.
Bingo. That, and the PRC’s expanding territorial claims in the region.
There was a war between China and Vietnam not to long after Hanoi took Saigon. The Chinese took the offensive and got their butts handed to them. The professionalism in the PLA was somewhat lacking after the purges of the Cultural Devolution. Competence was not only considered unnecessary, but also “bourgeoisie”, reactionary, and counter revolutionary. “All you need is revolutionary zeal.” It did not work out well for the Chinese.