Before you get outraged at the question, let me acknowledge that China was not ever a full blown colonial entity (the way India was, for instance). My point is not to get caught up in a debate over semantics, so let me just acknowledge that British colonial influence in China was limited to direct control over Hong Kong, and extraterritorial concessions over other parts. But, in effect, the Qing emperor lost control (for instance, on his right to limit opium imports) to British administrators. So, let us just simplify this and say “China was colonized”.
And then ask why did it happen.
Not how.
Everyone knows how it happened. The British had superior arms, were better trained, and more used to warfare. Further, the Qing officials were out to enrich themselves, and were easily bought over. The British were able to easily defeated the Qing Emperor in the Opium Wars.
The real question is why did this happen ?
The answer to this may affect how you view US-China relations today.
- One possible answer is that the Chinese are inferior racial stock (prone to greed, if you go by Linnaeus’ sub-classification developed right after the Opium wars concluded). If this answer correctly describes the question, then it means that the Chinese (along with the Indians, and Africans… everyone else who was colonized) are meant to be subservient to the master class. In this answer, Chinese prosperity is a gift from the master race, and the Chinese are ungrateful wretches if they don't recognize this. This is what Donald Trump (and perhaps a large fraction of Americans) seem to believe.
- Another possible answer is that the Chinese were outgunned due to a unique combination of factors that are unlikely to recur. Can you identify a unique combination of such factors, and confidently state that such conditions will not ever recur? If this answer correctly describes the question, then it means that the Chinese are going to reclaim their rightful place in the world, regardless of what anyone else has to say about it. Chinese prosperity is just a natural result of Chinese labors. This is what the Chinese leadership (and a majority of Chinese) seem to believe.
There is only one possible right answer to this. There is no “two seemingly opposite things can both be true at the same time” with this one.
One viewpoint will prevail.