In the late 18th century, the British developed a taste for tea. They imported both silk and tea from China and paid in silver and gold coins.
This began to affect the profits of the East India Company when tea became a popular drink in England. The British discovered that they can trade opium with China in exchange for tea. Opium however was being used in China only for medicinal purposes and its trade had been banned by The Confucian rulers of China.
The Chinese Emperors had banned all foreign traders from trading in China as they feared that the foreign traders might meddle in local politics and try to upturn power.
The British then started an illegal trade of opium in China. They smuggled opium into China through their sea ports and got it sold through some local agents.
Opium was not grown in England but in India by the poor peasants of Bengal. The poor peasants of Bengal were far from happy to grow opium for the British.
The British appointed agents who advanced money to the rich landlords, who in turn gave the money to the peasants as loans. The peasants were now forced to grow only opium on the land and hand over the produce to the landlord; who gave it to the British.
The British started paying low rates to the peasants, and selling the opium to the Chinese at a higher rate, thus increasing their profit margins. The peasants tried to resist this exploitation in many ways.
They refused to take advances, and demanded higher rates; some refused to grow opium and started cultivating potatoes and sugarcane. There were others who sold off the opium produced by them at higher rates to travelling traders known as pykars.
The monopoly of the British over growing opium was broken, when states not under British rule like Rajasthan, started growing opium and exporting it to China.