At this time both Britain and China were ruled by monarchs. They were imperialistic nations that wanted everything to benefit th growth and power countries.
The Chinese people in government were very in tune with their culture and would not stand for cultural influence from any outside nations so they set down regulations on trade to keep out foreigners.
For a long time China Isolated themselves from the Western World. When it was time for the Opium war China was not Industrialized yet. They had no technological advances that could match the British inventions.
The Industrial Revolution bestowed Britain a huge amount of fire power. They had a physical and technological advantage over the Chinese.
They were able to annhilate the Chinese Navy and take control of Hong Kong. The Chinese also had to pay Britain an indemnity for all Opium that was destroyed and for the cost of the war. An indemnity is money you pay for losing a war.
It being obviously necessary and desirable, that British Subjects should have some Port whereat they may careen and refit their Ships, when required, and keep Stores for that purpose, His Majesty the Emperor of China cedes to Her Majesty the Queen of Great Britain, etc., the Island of Hong‐Kong, to be possessed in perpetuity by her Britannic Majesty, Her Heirs and Successors, and to be governed by such Laws and Regulations as Her Majesty the Queen of Great Britain, etc., shall see fit to direct. **