They have a specially negotiated rate with Ireland. (The crux of this issue is whether Ireland granting them a special rate was legal under EU law.)
Edit: Actually, "special rate" is a bit misleading, as it implies Apple went to Ireland and said "hey, we'd only like to pay .05% instead of 12.5%" and Ireland said okay. The way it actually works (as described in the previously mentioned Senate memo) is that ASI (the Irish subsidiary) buys an iPhone from its manufacturer in China at cost for $200, marks it up to $600, and then sells the iPhone to Apple Italy for $600. Apple Italy sells the iPhone to a customer for $600 and recognizes $0 in profit, while ASI records $400 in profit. But ASI claims to not be a tax resident of Ireland and therefore when it buys an iPhone from China and sells it to Italy, that transaction shouldn't be subject to Irish taxes since no economic activity actually occurred in Ireland.
Therefore, the only taxes that ASI pays Ireland are from transactions where they actually sold products in Ireland itself. In 2011 ASI recognized profits of $22 billion, of which $50 million occurred in Ireland, and so they only paid ~$10 million in Irish taxes on that $50 million, leading to an effective tax rate of .05%.
Thanks for the example. It clarifies things. I can see how the EC claimed that Ireland was giving Apple 'state aid' although it looks like any company doing this would also be subject to a ruling like this.