At the time of the HK handover in 1997, HK represented a whopping 18% of all of China's GDP. Today, HK represents only 3% of China's GDP. This happened in only 20 years.
China is doing what I can imagine any other country in their position would do: take advantage of foreign companies using their discount labor pool to obtain the technologies necessary to first become self-sufficient and eventually to lead.
We're at a juncture now, where for better or worse, the US is no longer willing to put up with the status quo because the myopic policies of the past, focused on self-enrichment, are coming home to roost. It's probably too late honestly, whether American companies withheld the last few years of advancements or not, the Chinese have developed sufficient domain expertise to catch up and lead on their own in short order. They do have 3X the US population after all, and appear much more motivated in their pursuit of science and technology than the US is.
This point in history represents a number of long-term story arcs coming together at once. I'm not condoning it, there's lots of history here.