Trade between China and the outside world had been happening for centuries prior to the arrival of Portuguese carracks in east Asia in the early sixteenth century. Chinese sailors under the command of the famous Ming naval commander Zheng He (1371-1433) made seven voyages into the Indian Ocean and to the east coast of Africa in the early part of the fifteenth century, and thus China was an integral part of the maritime trading world of early modern world.
During the middle of the Ming dynasty, however, for a number of reasons Chinese engagement with these maritime routes became progressively less and was even restricted by the imperial government. As a result, trade with China became more difficult for foreign nations, such that by the time the Portuguese had established a presence in Macau in the middle of the 1550s, engagement between Chinese traders and foreign vessels was highly regulated. This meant that annual trade fairs became the major legal place whereby foreigners could buy the rich luxury items they craved, as for instance silk, tea and porcelain. Other illegal trade routes opened up as well, but if one was caught engaging in this the penalties were severe.
Thus, the port city of Guangzhou became a significant destination for foreign traders as twice a year officially sanctioned trade fairs were held. Located on the Pearl River Delta, yet navigable to the South China Sea, it was an ideal place for the Chinese government to host these encounters between traders. Since it was inland it was possible for it to be defended and yet it was easy enough for foreign vessels to reach it safely. These traders brought silver from places like Japan and South America and in return they bought the luxury goods mentioned earlier. During the late Qing dynasty, by which time Guangzhou had become one of the major trading ports of the world, it played an important part during the opium war period.