They are the largest economy on earth in terms of GDP (PPP). The US pretends like it is still the mid-1990s and they basically have unquestionable total dominance of the global economy and can just push everyone else around. I don’t think Americans really understand how much China has grown since then.

Blue countries the largest trading partner is the USA, while red countries the largest trading partner is China.
The US mentality seems to always be to “throw its weight around,” just use brute force to make everyone do what you want them to. They recently have pulled out of many international institutions and agreements and are imposing a trade war on the whole world.
The problem is that the US’s “weight” is a lot weaker these days, and so when the US is too hostile, it just causes countries to run to China, since they have an alternative now that is even bigger. The US abandoning global institutions is also causing a power vacuum that is being filled by China.
The US is basically handing the reigns of the entire world economy and international institutions to China to be the new world leader and just giving up its position.

It’s because it was 100% in China’s *interest* for the USA to betray all its former allies and tank its own soft-power.
China has been building economic alliances with other countries for decades, but it was always at a major disadvantage relative to the USA because it was so late to the game. The USA had about a 50 year head-start at setting up trade agreements all over the world, and had such a far greater amount of wealth to shuffle around.
Starting in about the late 1980s, the Chinese government finally really started considering a similar agenda, but the U.S. already had its hooks in all over the world, and the Chinese had a TON of diplomatic groundwork to do to convince other governments that they were a good partner.
For some senile makeup-slathered moron to storm into the White House and screw over *every* country in the world is so clearly to China’s benefit that it would seem plausible that Trump is WORKING FOR President Xi.
So now, after having been relatively quiet for a few weeks, Chinese authorities recognize this is the *perfect* opportunity to retaliate. The USA has lost all credibility on the world stage, and China can now just waltz in and claim to be the stable and trustworthy economic partner that the USA can no longer be.
Like Napoleon said: Never interrupt your enemy when he is making a mistake.