As President Trump and China’s leader, Xi Jinping, prepare to meet next week to extend a fragile trade truce, a fresh espionage scandal has shown that behind their diplomacy is a fierce intelligence rivalry.

At its center is Jensen Huang, the Nvidia leader and an influential ally of Mr. Trump’s, who has acknowledged having an affair with a Chinese businesswoman whom U.S. intelligence officials suspect of spying for Beijing. China has denied the espionage allegation.

Under Mr. Xi, the Chinese Communist Party has built a more sophisticated and assertive spy service that regularly highlights the importance of technological security and of threats posed by the United States. At the same time, the Central Intelligence Agency has said that Chinese companies are a legitimate target for espionage in areas like artificial intelligence, semiconductors and biotechnology.

Nvidia’s computer chips power the global A.I. boom and sit at the center of Washington’s efforts to keep that technology out of China’s hands. That makes Mr. Huang, who has lobbied Mr. Trump to ease restrictions on the export of advanced chips to China, a prime target, analysts say.

“It is not at all surprising, given the centrality of Nvidia to U.S.-China tech competition, and the importance of tech competition in the overall U.S.-China rivalry, that someone like him would be a top target for Chinese intelligence collection,” said Sheena Chestnut Greitens, an expert on Chinese security at the University of Texas at Austin.