Apple has conducted itself in Ireland in full compliance with Irish tax law. The so-called "loophole" (aka lawful structuring) was not something devious used deceptively but was well known to — and accepted by — the Irish tax authorities. The Irish government agrees that Apple has done nothing wrong and is embarrassed at being put into this invidious position.
The EU Commission — probably at the behest of the leaders of core EU "boss states" envious of the high-tech jobs Ireland's well-educated, English-speaking young workers are enjoying. — has argued, and the European Court has now decided, that the arrangements were illegal "state aid" and the Apple should pay up to €13bn in taxes neither it, its legal advisers nor the Irish tax authorities think is due. As an Irish politician has already commented, "they want us to tax Apple here on money made elsewhere".
There is no doubt that Apple, Inc. acted in good faith. Its shareholders (probably including you, gentle reader, if you have a pension plan, life assurance policy or other investment as few portfolios lack some holdings of the world's largest company) have every right to be furious at the EU's attempt to rewrite the laws in retrospect to their detriment.
Theresa May's government should make it clear that it will replicate whatever attractive arrangements Ireland had been offering in return for the relocation of Apple's European operations here. Under longstanding arrangements that predate EU free movement, Apple's existing Irish employees are able to move here without restriction and even vote in our elections. They will be most welcome.
Outside the statist, near fascist mindset of the EU, there is nothing to stop Britain abolishing corporation tax (a pointless tax anyway as the burden of it — as a company is a mere legal fiction — always falls in truth on its employees, shareholders or customers). Then watch all the great companies of Europe as well as the Americas move here to be based in a place with the rule of law, the greatest reservoir of international legal, accountancy and other expertise in the world, no retrospective legislation and with the world's financial centre at hand.
With the extra taxes earned not from stupid corporation tax but from the income tax of the new British companies' employees etc., the government could pay for the infrastructure and educational improvements required to make sure the country and the new corporate arrivals reap the long term benefits of their short term decision.