Although most of its
sales are outside the US, I believe that in reality Apple generates the vast bulk of its
profit in the US - specifically in California.
Let's say an iPhone is sold in the UK, generating a $200 profit. How much of that profit was really generated in the UK and how much in the US? The answer is to consider what would happen if Apple's US and UK operations were two distinct, independent companies: Apple in California would determine almost everything about the way iPhones are sold in the UK - where the Apple stores are located, what the stores look like, what their TV and billboard advertising should look like, what happens when a customer returns a product, etc. Apple US would then take this list of requirements and negotiate with a UK business partner. In that negotiation the UK partner has very little leverage - if the UK partner doesn't like terms Apple US is offering, Apple US can just find another partner. The UK partner then sells phones according to Apple's specification. The result is that the UK partner will have thin margins and almost all profit will flow back to the US.
Now perhaps I'm being hard on Apple's UK employees - maybe they are doing more than simply working to a specification given to them by their California colleagues. In this case it would be fair to say that a somewhat larger portion of that $200 is actually generated in the UK - so the total tax Apples pays on that $200 profit would be a combination of US and UK tax rates. But there is absolutely no reason why Irish tax rules should apply to the allocation of profit on the sale of an iPhone in the UK.