Image copyright Getty Images Image caption President Trump and China's Vice-Premier Liu He shake hands on an initial trade deal

There are increasing hopes in Washington and Beijing that an agreement to help resolve the US-China trade war could soon be in sight. But this is a rivalry between two superpowers that is about much more than just trade, it is one that spans economics, defence, culture and technology.

So what does the United States want from China - and what is the US endgame?

The short answer is the phase-one trade deal that President Trump and the Chinese Vice-Premier Liu He shook hands on in the Oval office last month. But tensions between the two countries go far deeper than just trade, and no one I've spoken to in Washington thinks that this outline deal will make much difference on its own.

Media playback is unsupported on your device Media caption How does America see its relationship with China?

There has been a pronounced negative shift in attitudes to China in the US in recent years, and it's important to realise that this shift predates Mr Trump's arrival in the White House.

"I think if you'd seen a Hillary Clinton presidency, or another Democrat or another Republican in 2016, you would have seen this sharp turn," says Daniel Kliman, a former senior adviser at the US defence department.

"There was a sense that our approach to China wasn't working," says Dr Kliman, now director of the Asia-Pacific Security Program at the Center for a New American Security (CNAS).

Image caption US attitudes to China would have changed no matter who was in the White House, says Daniel Kliman

There are many reasons for this rise in tensions. The promised economic benefits of China joining the World Trade Organisation in 2001 never materialised, says Ray Bowen, who worked for the US government as an economic analyst from 2001 until 2018.

China never intended to play by the rules, he says. "It's more the case that China intended to join multilateral fora in order to begin to shift how multinational fora regulate global trade." In other words, China joined intending to change rather than be changed.

Image caption China always intended to change the way global trade is regulated, says Ray Bowen

The result was a vast wave of job losses and factory closures in the US known as the "China shock". The so-called "rust belt states" that voted for President Trump in 2016 bore the brunt.

Many US companies moved production to China to take advantage of lower labour costs. However, according to Daniel Kliman there was a high price for companies moving to China: "China has forced them to hand over their technology, their intellectual property," he says.

And, even those companies that didn't relocate production found that China somehow got hold of their trade secrets. Law enforcement agencies in the US have a long list of charges against Chinese individuals and companies for spying and computer hacking.

Image copyright Getty Images Image caption There are more than a thousand intellectual property theft investigations from US firms leading back to China, says FBI boss Christopher Wray

The FBI's director, Christopher Wray, recently told US Congress that there are currently at least 1,000 current investigations into the theft of intellectual property from American firms that lead back to China.

The US government has estimated that the total value of intellectual property stolen by China in the four years to 2017 alone to be $1.2tn (£936bn).

According to Dean Cheng of the Heritage Foundation, a US conservative think tank, this is the primary reason relations between the US and China have soured.

Image caption China has attempted to "be able to cut the carotid artery of global trade", says Dean Cheng

"When companies are finding out that their patents are being rifled through, when their product is being reverse engineered, when their R&D processes are being hijacked, more and more companies concluded that partnering with China was not turning out to be profitable, and could actually be downright negative," he says.

From inside government, economic analyst Ray Bowen says he noticed the mood change in late 2015. People who had previously advocated engagement with China were now alarmed to see how fast China was catching up.

Rivals is a season of in-depth coverage on BBC News about the contest for supremacy between the US and China across trade, tech, defence and soft power.

Read more Rivals features

At the same time in the Pentagon, Brig Gen Robert Spalding was leading a team of people trying to formulate a new national security strategy to deal with China's rise and influence. He has since left the military, and has written a book called "Stealth War, How China Took Over While America's Elite Slept".

When asked about the threat that China poses to US interests, Gen Spalding's reply is stark. "It's the most consequential existential threat since the Nazi party in World War Two.

"I think it's a far greater threat than the Soviet Union ever was. As the number two economy in the world, its reach, particularly into the governments and in all the institutions of the West, far exceeds what the Soviets could ever manage."

Image caption China is "a far greater threat than the Soviet Union ever was", says Brig Gen Robert Spalding

The result of Gen Spalding's work at the Pentagon was the National Security Strategy, published in December 2017. It's regarded as the lead document within government, designed to guide every department, and represents a profound shift in approach according to Bonnie Glaser, director of the China Power Project at the Center for Strategic and International Studies.

"There has now been a movement away from the war on terror, and instead, competition among major powers has taken the place of terrorism as the major threat to the United States," she says.

The US defence department now believes that addressing the rise of China is one of the major military objectives of the United States in the coming decades. The speed with which China built, and then militarised, a string of artificial islands in the South China Sea in defiance of international law has alarmed many in Washington.

According to Dean Cheng, $5.3tn of trade passes through the area every year. "China's actions were in a sense an attempt to be able to cut the carotid artery of global trade," he says.

Image copyright Gallo Images Image caption Subi Reef in the Spratly Islands: China has built and militarised a string of artificial islands like this in the South China Sea

China has been very clear in its ambitions to lead the world in the important technologies of the future, like robotics and AI. "This is very core to the competition now," says Bonnie Glaser, "because if China were to succeed in these areas, then it probably would supplant the United States as the leading power in the world."

That is what is now at stake. America's military supremacy is based not on a huge standing army, but on high-tech weapons systems. If China takes the lead in these crucial technologies, then the US may not be able to keep up for long.

Daniel Kliman believes that the non-military technological race is also crucial. "Not only is China perfecting technologies for surveillance and censorship at home, but increasingly exporting these technologies as well as finance and knowhow abroad."

He believes the battle with what he calls "high tech authoritarianism" is one that will become more and more central to the conversation about China.

Image caption The US now sees competition from other powers as its biggest threat, says Bonnie Glaser

So, don't expect the US position on China to change in the near term, even if President Trump loses the coming election. The mood in Washington has changed.

The only real political conversation is not about whether to take on China but how best to do it. Many Democrats prefer engaging with allies against President Trump's unilateral approach. However, most Democrats know there are few votes to be had by advocating a softer China policy.

Rivals - America's Endgame, will be broadcast on BBC World News on Sat 9 November at 07:30 and 19:30 GMT and Sun 10 November at 11:30 and 16:30 GMT. It will be available to UK viewers on iPlayer from 17 November.