1. Apple told the EU that they were paying taxes in Ireland
2. Apple told Ireland that they were paying their taxes in the US
3. Apple told the US that they were holding the cash overseas instead of bringing it back and paying US corporate tax rate
Step #1 is recognized practice in the EU, Step #2 is acceptable to Ireland, and Step #3 is legal in the US. What the EU decided is that if the net effect of #2 and #3 looks like a special tax benefit specifically for Apple, it should be treated as one. That is. Ireland "should have" collected the taxes as the money goes through, instead of participating in the shell game. Specifically, Ireland's tax guidance that it was OK for all the European profits to be allocated to a notional Ireland-based "head office" (step 2) was what triggered the commission's ruling.
Apple, of course, is waiting for the next tax holiday or a really good reason to spend the money. Then they can either bring it back to the US (paying the lower rate rate; politicians are talking about 15%) or spend it in Europe and finally pay their Ireland taxes.