The European Union warned us this week not to expect a speedy conclusion to the long-running investigation into the legality of Apple’s tax arrangements in Europe. The delay follows a decision back in December to expand the scope of the investigation.

But while the wheels of EU tax investigations may grind exceedingly slowly, I’d be willing to wager quite large sums of money on the final outcome. It looks to me increasingly clear that Apple’s tax arrangements with the Irish government are going to be declared illegal, and that Apple is going to be faced with a significant bill for unpaid tax …

Let’s start with the basics of how the whole situation arose in the first place. You can skip this section if you’re already up to speed on the background.

In a simple world, one of two things would happen when I buy an iPhone in the UK. Either the Apple Store in London sends the money back to Cupertino, and Apple pays U.S. tax on it there, or the money is paid into an Apple UK bank account, and Apple pays tax on it in Britain. In reality, however, neither of these things happens – and there are two reasons for that.

First, every country in the world sets its own corporate tax rates – the percentage tax a company pays on its profits. In the USA, the federal corporate tax rate is 35%. In the UK, it’s 20%, so Apple would already be better off paying UK tax on British sales. But it realized it could do better than that if it shopped around.

Ireland has one of the lowest rates of corporate tax in Europe, at 12.5%. By establishing a European headquarters in Ireland, and sending all the money from sales across Europe there, it could pay a lot less tax. But it doesn’t end there.

Ireland sets its corporate tax so low because it wants global companies to establish their European headquarters there. That creates jobs, and pumps money into the local economy. The bigger the company, the greater the benefit to the economy. So for very large companies – like Apple and Google – Ireland offered them a special deal (reportedly brokered by Steve Jobs). ‘Choose Ireland for your European HQ,’ it said, ‘and you only have to pay 2.5% tax.’ That’s five times lower than the rate paid by most companies.

So rather than pay 35% for sending the money back to the USA, or 20% for keeping it in the UK, Apple funnels all sales from European countries into Ireland – and pays just 2.5% tax on the lot.

I should stress that all this is perfectly legal … for Apple. Apple’s legal obligation is to pay the tax each country demands from it. If Ireland demands only 2.5%, Apple’s only duty in law is to smile broadly and write the check. (Ok, it isn’t actually legally required to grin as it does so, but it would be hard not to, right?)

This was what allowed Tim Cook to truthfully tell a Congressional hearing into Apple’s tax affairs that “we pay every dollar that we owe.” Apple does indeed pay every dollar, or Euro, it is required to. The company has broken no laws.

But the same is probably not true of the Irish government. Ireland is a member of the European Union, and there are laws determining what member states can and cannot do where corporate taxes are concerned. Precisely because the EU knows countries might be tempted to offer special deals to large companies, and because it doesn’t want a race to the bottom where those companies end up paying next to nothing in tax, it specifically outlaws them.

Special deals offered only to certain companies are known as state aid, and that’s illegal.

While we’ll need to await the outcome of the investigation before we know whether Ireland’s deal with Apple is formally found to be illegal state aid, it’s hard to see how it could not be.

State aid is any advantage granted by public authorities through state resources on a selective basis to any organisations that could potentially distort competition and trade in the European Union (EU).

‘Any advantage’ – check. A tax rate of 2.5% instead of 12.5% is one hell of an advantage.

‘through state resources’ – check. The deal was struck with the Irish tax authorities.

‘on a selective basis’ – check. Apple got a deal, as did other large companies like Google and Microsoft. Mama and Papa’s Pizza Place, not so much.

‘distort competition and trade’ – check. When one company pays one fifth of the tax rate paid by competitors, that massively distorts competition.

And similar deals in Belgium, Luxembourg and the Netherlands have already been declared illegal. So the case that Ireland broke the law seems to me cut-and-dried: it did.

I said earlier that Apple hasn’t broken the law, which means it’s not on the hook for penalties or charges. But it is on the hook for the difference between the tax it actually paid and the tax it should have paid. Which is the difference between 2.5% and 12.5%. On all of the revenue Apple funnelled through Ireland from the whole of Europe. For ten years. That’s a lot of money.

Apple last year told shareholders that it was unable to say just how much money that would amount to, only that it would be a ‘material’ amount – where ‘material’ is finance-speak for ‘a shedload.’

But that hasn’t stopped others doing the sums. Bloomberg estimated the total tax liability at more than $8B.

If the European Commission were to conclude against Ireland, the European Commission could require Ireland to recover from the Company past taxes covering a period of up to 10 years reflective of the disallowed state aid. While such amount could be material, as of March 28, 2015 the Company is unable to estimate the impact.

But Apple’s potential European tax liabilities don’t necessarily end there. A number of European countries have questioned the legality of Apple funneling profits from sales in their country back to Ireland. Those countries believe Apple should be paying tax in the country where the sales were made.

Some European countries have done more than question the arrangements: they have flat out rejected them. Italy, for example, last year accused Apple of failing to declare more than $1.3B of income earned from 16 Italian Apple Stores, and presented the company with an additional tax bill for €318M ($347M). Apple paid up.

If other European countries do the same, it could face similar bills from countries across Europe, with the total potentially running into more than a billion dollars, taking that $8B estimate to upwards of $9B.

In comments on past pieces on this topic, some have questioned the fairness of Apple being asked to pay more tax than was demanded at the time. If Apple paid what was asked of it, they argued, surely it’s unfair to come asking for more later? But the position for Apple is no different to that of you or I. If the IRS or HMRC makes a mistake in calculating our personal taxes, it doesn’t let us off when that error comes to light. It might offer us an apology and time to pay, but we’d still have to fork over the cash. The same is true of Apple.

Finally, if you’re in any doubt about the eventual outcome of the investigation, you need to consider the politics. At a time when European economies are – like the U.S. one – still struggling, there is enormous public anger at the idea of large companies being able to get away with paying less than their fair share of tax.

So my view is that both the law and the public mood is clear. Apple is likely on the hook to hand over more than $9B in back taxes – or around three times the amount it paid for its largest ever acquisition, Beats. That’s got to sting. But with cash reserves of around $200B in the bank, perhaps not too much.