It's a US company with (mostly) US shareholders. They make things people like to buy and sell them all over the world at a profit. They pay local sales and other taxes (VAT, business rates on their shops, salaries, tax and NI on local employees, and so on), but the profit goes back to their owners and is taxed where the company is registered. What's the story here?
The only anomaly is that for years US corporation tax rates were widely regarded as uncompetitively high (nearly twice the rate in the UK, for example) and they've been talking about reforming the system for decades. Apple, in common with most other US corporations with signficant overseas earnings, temporarily kept their overseas revenues in a holding bin waiting for the date of the much promised reform so they could finally repatriate the earnings where they belong. That day has now come.