When the vast majority of China's economy is built on selling products to the West, it's completely irrational for them to engage in a war with the West. Especially considering that China was less than a generation ago a third world country absent this selling things to the West thing. That's not going to be replaced by relationships with Nigeria and Afghanistan any time soon. This isn't a military story at all, much as it's the exciting sensationalist thing to focus on. If it was the mismatch would be all the more striking as China has no meaningful force projection capability and zero experience even if they do develop it. A single MEU probably exceeds all of China's ability to project beyond its land border at this point and would be able to match anything they could put up for at least another generation, and they're a tiny part of the already relatively small Marine Corps.
You can underestimate China all you want. But you explain the situation about 15 years ago with a backwards-looking (or at best stagnant) outlook. Nigeria and Afghanistan, not so much. Philippines, Indonesia, Thailand, Pakistan, Iran, Japan, Korea...they're a different story.
Their force projection today is real and growing. Search "Nine-Dash Line"--their force projection in the South China Sea is calculated, effective, and uncontested.
De jure international law is quite meaningless when
de facto control is on terms dictated by China when no one else is willing to stand up to them militarily.
China's economy is diversifying, growing, and no where near as beholden to US purchasing as the prevailing narrative would have you believe. It's trade surplus is shrinking. It's the second largest tech economy in the world. It's exports are moving from raw materials to manufactured goods of increasing sophistication.
Then there's the question of how many soldiers (or in the case of China, how much military equipment) can be purchased relative to its US counterpart. The short version is, $1 in the hands of the Chinese military goes about as far as $3-4 in the hands of the US. Couple that with the reality that China only needs to have a projection range about 1/4 that of the US (the distance between Chinese air & naval bases to the 9-dash line vs. the distance for US bases to the 9-dash line), and that's effectively a force multiplier for their equipment. On top of that, the US is projecting power across the Atlantic, in the Mediterranean, the Northwestern Indian Ocean / Gulf States, and across the Pacific--that leaves only a fraction of US naval and air power to directly counter Chinese power.
There's also the disparity between domestic policies in the respective contries. The Chinese nationalist agenda is that of growing power and national pride--thus power projection is quite popular domestically in China. The US is pivoting away from this as a source of national pride--the current administration's aversion to "nation building" is the physical manifestation of that. And this isn't a left-right divide over policy, this is an emerging norm across the political spectrum--a royal flush of belief within academia, political elites, political outsiders, and popular opinion.
The feel-good narratives of Pax Americana Eternal plays well to misguided feelings of nostalgia. The reality is something entirely different, and foreign policy based on nostalgia will all but certainly lead to miscalculation and war. Look for some candid comments of US military leadership regarding war games, and the prevalence of the surprise at the frequency with which these devolve into all-out war.