Exactly, no forever friends or enemies. The Brezhnev Doctrine and Soviet expansionism/hegemony on the Eurasian Continent drove the United States and China together, despite the unresolved political status of Taiwan (well, China lacked the means to take Taiwan back then anyway). From Stalin until Brezhnev, Moscow always wanted China to become an ally of subordination like other Warsaw Pact nations, but with 600 million people and a highly nationalistic CCP with memorizes of foreign occupations still fresh, it was unacceptable for the Young PRC to allow itself to become a subordinate of another hegemonic power, not mention that Moscow sought to station its troops on Chinese territories. It was Khrushchev's realization that China would not become a subordinate (or allow Soviet troops to be stationed on PRC territory) that led him to withdraw all Soviet industrial aids to China in 1960. Then you got the ideological rift between Moscow and Beijing after 1956, as well as Moscow's vocal support for India during the 1962 Sino-Indian War. They all contributed to the eventual Sino-Soviet Split.
With the marriage of convenience between China and US from 1972-1989, however, there is another problem for China. Beside the shared common goal of containing the USSR, Washington sought to ideologically and materially transform China into a liberal democratic capitalist state (if not states). Anything less would be unacceptable for Washington in the long term. In other words, you got Wilsonianism on steroid. In other words, Washington would not feel secure unless every single major power becomes a liberal democracy with institutionalized handicaps (such as a Congress or Parliament where making war or other drastic actions/mobilizations by the state would be difficult and require lengthy compromises between interest groups) in place to limit the expansion of state capacities. My Dad used to tell me that back in the 80s, every college student would turn on their radio and listen to Voice of America, despite doing so was (and still is) illegal. It is also why after the Tiananmen Incident, the US sanctioned China so harshly because it realized that the CCP Party State could not (and still cannot) be easily transformed into a liberal democratic capitalist state. Clinton and Bush would try again by granting delinking human rights from annual MFN renewal in 1994 and allow China to join the WTO in 2001 with the hope that economic liberalization would lead to political liberation (thus, end of the One-Party rule). However, China did liberalized economically with private firms dominating the Chinese economic landscape, but liberalization actually solidified support for CCP. As a result, you now have the Trump-Biden disenchantment and all-out strategic competition. And as the response to the Wuhan outbreak in 2020 has shown, with no institutionalized handicaps, the CCP Party State is fully capable of swift mobilizations against national emergencies. Such state capacity is also extremely effective in stifling dissent, ensuring there is only one voice united behind the state and the CCP faction currently in charge (I am not going to judge if it is good or bad here).
For China, liberals have long argued for embracing Washington's offer and develop a political system where multiple interest groups have their voices represented in a parliamentary democracy. However, the problem with China that it is a nation with very little resources, while it has 1.4 billion mouths to feed. In other words, Chinese are far more likely to be on survival instincts than the Anglos, whose ancestor conquered vast territories and resources for their descendants to enjoy. With 1.4 billion people on survival instinct, liberal democracies (emphasizing limits placed on state power) would most likely be hijacked by powerful interest groups/cronies with money and guns, turning the country into warring factions who could overtime disregards to rule of the game. A liberal democratic China would also likely to lose Xinjiang, the richest territory with most of China's oil, gas, and coal. This is cause turkic people are still the majority in Xinjiang and has a more martial culture than Han Chinese immigrants. In other words, One-Party system is currently (not necessarily the future) the best of the bad apples available to more justly redistribute limited resources in a nation on survival instinct for the past 200 years. It is also why despite the success of market economy in job creation and stability maintenance, China simply cannot allow the emergence of people like John D. Rockefeller, whose wealth was powerful enough to bury an entire nation.