There was (is?) a substantial online trade in psychoactive "research chemicals" starting in the early 2000s -- stimulants, hallucinogens, cannabinoids, and anything else you can imagine. They were recreational drugs that were not yet formally scheduled in many countries [1], often resembling existing molecules, sometimes mined from academic literature or from enthusiasts experimenting with unpublished analogues based on intuition or SAR predictions. This started out in the US and Europe. Operation Web Tryp [2] is the first major action I recall against these vendors. European countries without the equivalent of the Analogue Act continued to play whack-a-mole against new substances, which meant that vendors could keep going as long as they didn't foul afoul of scheduling updates or of the much-blunter American Drug Enforcement Agency.

Around 10 years ago, maybe a bit earlier, risk-averse European psychonauts started outsourcing the synthesis of novel molecules to labs in China, much like larger pharma research organizations were doing for basic synthetic work. Mine the literature, come up with some targets and proposed synthesis outline, outsource to Chinese vendors. The only work necessary on the buyer's end was to run analytical chemistry to ensure they were getting what was planned, then consume the drug to see how it behaves in vivo. Some of the more successful drugs that were sampled this way escaped the tight knit psychonaut groups and started popping up as items of commerce; does anyone remember the explosion of JWH series synthetic cannabinoids? (Fortunately, those strange brews seem less popular in the US since states started legalizing ordinary cannabis.)

The first really alarming substance I saw coming from these small custom synthesis vendors just has the code name U-47700 [3]; it's an opioid with a weird structure, never tested in humans until gray and dark market vendors put it on the map. I also saw opioid dependent chemists researching modifications of the OTC drug Loperamide [4] so that it could cross the blood brain barrier and satisfy their craving.

This is all a long winded way of saying that Chinese vendors were deliberately sought out by self-experimenting psychonauts and people with drug dependencies years before news reports of Chinese fentanyl in the US. It didn't start with opioids, but it eventually ended there. The drug flow from Chinese laboratories started as a Western "pull" rather than a Chinese "push." Opioids were also among the last drugs to start flowing in volume. That's why I think that attributing the drug flow to a Chinese government plan for Opium War revenge is ridiculous.

I had access to invite-only psychonaut/chemist forums for years. I tried visiting one of them just now and it's now just a domain landing page. So no citations for the chronology of my story, sorry, but major parts of it should be corroborated by what you can find on more open forums like Bluelight.

[1] Though the Federal Analogue Act in the US meant that novel "fun" compounds being sold for human consumption were illegal without any new legislation being needed.

[2] https://en.wikipedia.org/wiki/Operation_Web_Tryp

[3] https://en.wikipedia.org/wiki/U-47700

[4] https://en.wikipedia.org/wiki/Loperamide