By far the no1 risk factor for China losing is low morale inside the country.
The difference in economy size (even bigger if you strip away down to productivity) all but guarantees long term victory. It is also impossible to disrupt China's economic advantage, US doesn't have anywhere enough strike power to make it through air defenses.
Therefore, the coming US attack on China is a war that will take on very similar aspects as the Japanese attack on America in ww2, in that it will be an air/naval conflict between a larger economy with an initially smaller fleet vs a smaller but much more mobilized economy, and where the homeland of neither country can be seriously threatened until the very end of the conflict.
Just like Japanese strategists surmised in ww2, their best path to victory was not to hunt down the whole USN or destroy American factories, which was impossible, but inflict morale victories in order to negotiate from a position of strength. This will also be the main threat facing China during ww3.
Besides just attempting to create advantegous large set piece battles to decrease Chinese morale, US would also use its propaganda apparatus.
Regarding morale and similar sociology-type soft metrics, Chinese and US morale can't be comparable in any shape or form, they are not in the same league now, not to mention in case of actual war regarding Taiwan (which for China will be a defensive, righteous, sacred one, and for US offensive-political one). I will give you some overall related statistics for example. I can give proof from Western sources themselves of everything I will state here. To preface, right now, the US is objectively way more compatible for a real civil war amongst themselves than to lead an offensive war against another superpower 10000km away (with double the strength of the USSR at least) from their shores and in their 100km backyard, for their 23rd province of the said superpower (which btw simply dwarfs them in industrial might many times over realistically).
Current government approval ratings are 20% for Biden in the US.
Edelman put 40% of the trust in the government for the US in 2023 overall, and China still 90%.
"My family and I will be better off in five years" - 65% in China, vs 36% in the US. So far this data was from Edelman 2023.
"Is my country headed in the right direction" - Around 90% China, 45% US, IPSOS 2019.
"Does my government work for everyone's benefit" - China around 80%, the US around 20%. Pew Asian Barometer 2020.
"How much do you trust your media" - China around 90%, US around 25%, Edelman/Gallup 2022.
The Global Happiness 2023 survey from Ipsos shows that China is the happiest country in the world at 91%.
A 2019 UC San Diego study shows a high level of satisfaction among the Chinese across a range of aspects up to 95%.
Latana’s Democracy Perception Index 2022 shows that 83% of Chinese believe their country is democratic.
Edelman puts the US in the 6 most polarized countries in the world in their study with people doubtful that "divisions can be overcome".
Gallup 2015, "willingness to fight for your country" - 71% China, 44% America, but really probably worsened for the US in major ways since then.
The US has the double suicide rate of China, the highest anti-depressant use in the world, way higher homicide rates, incarnation rates, more homeless, drug addicts, mass riots and lootings, etc. Easily verifiable.
Compare that to China now which has almost 0 anti-depressant use, has the lowest violent crime rate, the lowest incarceration rate, and the lowest recidivism rate in the world, and is typically enforced by unarmed cops.
Look at the US's racial, ethnic, ideological, political, federal, and financial, divisions, just look at pure metrics how many times are they more are they divided than China (you can check this yourself or use basic life sense to deduce this simply truth, but I have data for that too if needed). Also, if someone argues that this is just their civil population and not the military, where does the military come from?
They are employed by this same mentally unstable and divided general population who increasingly hate their own country, and their compatriots, and who, at best, have simply nothing in common with one another, and are there nearly entirely for monetary reasons probably.
A soldier from which side is then way more likely to give their maximum performance, stay all night, and give 100% of his bodily and mental powers in the case of a war?
Which civilian population would give it his 100% effort, stay all night in industrial factories, working to produce more military equipment for their country, which businesses will assist more, the US in China?
Who controls businesses in China vs in the US? Who has a better civil-military fusion? Who has more engineers, and factory-skilled workers? Not to mention that in the US even if they have, people are simply not willing to give their effort, as seen from these metrics.
Not that its population will help the war like in China, but the population in the US will probably start those violent inter-racial civil riots, lootings, attacks on the police stations, burning police cars, etc, really close after the war starts and it will keep intensifying over and over.
As a new poll suggests, the increasingly stark ideological divides of American politics have come with personal consequences. Nearly one in five voters — 19 percent — said that politics had hurt their friendships or family relationships. Twenty percent of Democrats and 21 percent of independents said so, compared with 14 percent of Republicans. But in interviews, people across the ideological spectrum told similar stories of estrangement: conversations broken off with siblings and children, decades-long friendships that have gone quiet. Most dated to the early days of Mr. Trump’s presidency and have not abated since its end.
Perhaps the most striking change is the extent to which partisans view those in the opposing party as immoral. In 2016, about half of Republicans (47%) and slightly more than a third of Democrats (35%) said those in the other party were a lot or somewhat more immoral than other Americans. Today, 72% of Republicans regard Democrats as more immoral, and 63% of Democrats say the same about Republicans.
The poll also finds that nearly half of young Americans (48%) have felt unsafe in the past month, with 40% worried about falling victim to gun violence. Trust in the Supreme Court to “do the right thing” has fallen by ten percentage points over the last decade, while less than half of young Americans feel like their local police department makes them safer. Nearly half (47%) of Americans under the age of 30 report “feeling down, depressed, or hopeless,” and 24% have considered self-harm at least several days in the last two weeks.
Just 4% of U.S. adults say the political system is working extremely or very well; another 23% say it is working somewhat well. About six-in-ten (63%) express not too much or no confidence at all in the future of the U.S. political system.
Positive views of many governmental and political institutions are at historic lows. Just 16% of the public say they trust the federal government always or most of the time. While trust has hovered near historic lows for the better part of the last 20 years, today it stands among the lowest levels dating back nearly seven decades. And more Americans have an unfavorable than favorable opinion of the Supreme Court – the first time that has occurred in polling going back to the late 1980s.
Here is some data that shows that the sociological situation in the US is not only not improving, but it's getting worse and worse every year. There is simply no hope, judging from it: