The Opium Wars were two wars fought by the Qing Dynasty and western powers over the trade of opium by western powers in China.
The first Opium war took place in 1839. The East India Company produced large amounts of opium in India, selling it to private traders who would transport it to China. Concerned with moral decay and economic issues (the amount of silver flowing out of China), the Qing emperor charged High Commissioner Lin Tse-hsu with ending the trade. Lin seized a lot of opium, destroying the majority of it in Canton. This led to war with the British forces, whose navy landed a series of humiliating defeats to China.
The war ended with the signing of the first “unequal treaty” which ceded Hong Kong to the British, and establishment of treaty ports, as well as a payment of 21 million dollar to the British.
The second Opium war took place in 1853. A new imperial commissioner tried to stamp out the opium trade, destroying a British ship in Canton. This led to war which eventually led to the western powers signing the Treaty of Tientsin, which forced China to pay reparations, open new ports and legalize the opium trade.