Because the trade with China was an isolationist nation which saw Western ideas as problematic for the current state of their nation, because Western nations did not possess anything of value to exchange, they began to look for different methods, among them the sale of drugs and addictives to the population. By 1839, opium stocked by the United States, the United Kingdom, and France had reached the isolated peasants and the workers spent 2/3 of their profits to maintain their addiction.
Before this, the Chinese emperor banned opium and expelled the British merchants, who upon arriving in London complained to the British government, which decided to attack China with its powerful fleet to force it to buy opium cultivated in British India.