Iphone consumed outside the United States is produced and sold by Apple's branch in Saint Kitts and Nevis (a country). Since Saint Kitts and Nevis is exempt from corporate income tax, products sold by Apple outside the United States, after deducting costs, sales expenses, logistics expenses and sales national taxes (such as China's tariffs and value-added tax), all enter Apple's pocket without paying taxes to the US government.
In addition, Apple's patents are held by its branch in Saint Kitts and Nevis. Every time Apple sells a mobile phone in the United States, it needs to pay a patent fee of about $300 to their branch in Saint Kitts and Nevis. In this way, Apple's American head office has been operating at a loss, but the cash flow of Apple Group accounts for one tenth of the US GDP.
This method is adopted by many big companies, such as Intel, Google, Yahoo, Microsoft and so on.