The idea that Ireland lured Apple is wrong. Apple used a bunch of manipulations to lower their taxes. Apple knew from the get go that they were dodging taxes. Apple went to Ireland, where they thought they’d get away with it. And they didn’t.
Well, “lured” is perhaps the wrong word. But Ireland has for many years pursued a very deliberate strategy of attracting inward direct investment through (among other things) a business-friendly tax regime. Low corporate taxes, in other words. What first drew Apple to Ireland (in 1980) was low tax rates and other incentives designed to attract high-value manufacturing industry - IT, pharmaceuticals, that kind of thing - to locate in Ireland. Apple was by no means the only high-value manufacturer to be attracted, but it was the most prominent and one of the most successful; by 1990 Apple was the largest single manufacturing employer in Ireland.
By the 1990s, however, other countries were copying Ireland’s strategies for attracting inward manufacturing investment, so Ireland adopted new strategies intended to attract different sectors. In particular, Ireland sought to establish itself as a centre for international financial services. And Apple took advantage of that regime to book a lot of transactions in Ireland to take advantage of favourable tax treatment for financial transactions.
I seriously doubt that Apple thought they were “dodging taxes”. They knew they were getting a very good deal, but they were entirely up-front with the Irish tax authorities about what they were doing, and as far as they were concerned they were structuring their affairs to take advantage of tax incentives offered to them with the specific intention of encouraging them to structure their affairs in that way. The EU ruling isn’t treating this as a tax dodge by Apple, but as an unlawfully anti-competitive state aid provided by Ireland to Apple.