Japanese media wrote that the agreement between Tokyo and Hanoi are made against the background of "the growing influence of China in this region." From the material:
The use of a base in Cam Ranh by Japanese warships will help curb China’s military activity in the South China Sea. In this case, the base will be used exclusively by those ships that will participate in the exercises or leave the Japanese bases to counter the sea pirates. Reconnaissance ships will not enter the support base in Vietnam.
It is particularly emphasized that the decision was made in connection with the "activity of the PRC on the Spratly Archipelago."
For reference: Spratly - a group of islands in the South China Sea, around which the most active fishing is conducted. The administrative affiliation of the Spratly Archipelago is immediately disputed by a group of states of the region: China, Japan, Vietnam, the Philippines, and Malaysia. In addition, Taiwan claims the islands.