China militarily force defeated by imperial countries then make them to put sign in unequal treaties. Hence, they got trading rights along with legal privileges in China.
Step-by-step explanation:
During the 19th century, the British suffered a lot of unstable trade relations with China and Japan. They were importing a lot of goods from them but they were unable to export a lot of goods.
This is because British consumes a lot of tea and China being one of the largest producers of tea, became their sole source of tea. British tried to sell products like woollen clothes but it was not suitable for Chinese who were accustomed to wearing cotton and silk clothes. Then, China signed Treaty of Nanjing.