The complexity of handling customs, duties, and taxes on any given international shipment depends on the laws and trade agreements in place between the exporting and importing countries. Countries with free trade agreements can make such transactions much simpler, while duties and tarriffs are often in place to intentionally make it harder for certain types of goods to be imported/exported economically.
Every country has an agency that handles customs and imports. In the United States it’s US Customs and Border Protection, and in China it’s the General Administration of Customs. These agencies are responsible for regulating all shipments into and out of their parent country, enforcing their countries’ trade laws, and collecting all applicable duties and taxes.
Duty fees are based on the contents of your shipment and any applicable duties in place on that type of product. Depending on the two countries in question, some goods may be imported duty-free, while others may be subject to steep fees. In some countries a VAT(Value-added Tax) or GST(Goods and Service Tax) is also assessed at various rates, depending on the product being imported.