Does Apple pay tax, and how much tax does Apple pay? Why does Apple pay so little tax in Europe? It's an incredibly profitable company.

Apple is in hot water - again. After its run-in with the feds earlier this year, Apple is in trouble with a really scary foe: the tax man. After a three-year investigation into the company's tax affairs, the European Commission has ordered Apple to pay 13 billion dollars in unpaid taxes to the Irish government… but the Irish government doesn't want it.

It's all very confusing, so we've put together this guide to Apple's tax arrangements: how much it pays, why it's been told to pay more (and why the Irish government is saying "no thanks"), and how its tax setup compares to the other tech-industry giants. If you've got any more questions about Apple's taxes, add them to the comments.

If you'd prefer to hear about Apple's tax affairs, have a listen to episode 30 of the UK Tech Weekly Podcast, embedded below - the discussion starts at 12.20. (The podcast comes out every Friday. Follow the UK Tech Weekly Podcast on Twitter to get notifications of new episodes.)

Updated 11 Oct 2016, to discuss a poll that claims 47 percent of Irish people don't want Apple to pay them any more taxes, as compared to 39 percent that do.

Read next: EU starts in-depth probe into Apple's tax affairs | Irish MPs will not grill Google and Apple on tax

Does Apple pay tax? How much tax does Apple pay?

Yes it does! Quite a lot, in fact. Not far off $3bn in the last quarter. But whether that money is funnelling into your local economy very much depends on the country you live in.

Apple stands by its belief that it should be taxed principally "where the value is created", and that this is in the US: its products are researched and developed in California. Accordingly, Apple's main tax burden falls in that country. Apple chief financial officer Luca Maestri has stated: "These are profits that are taxed in the United States, and for anybody that understands the US worldwide tax system, this is very easy to understand."

In its most recent financial results, for Q3 2016 - which was a moderately disappointing quarter for Apple - the company declared revenue of $42.4bn and an income after operating expenses (and additional income) but before tax of $10.5bn, and allocated £2.7bn of that for income tax. (You can read Apple's Q3 2016 financial statement here.) That's a rate of 25.5 percent, which sounds pretty solid, although it would probably be higher if Apple held less of its profits offshore - Tim Cook has stated that he cannot repatriate the firm's overseas holdings to the US because it would cost 40 percent of the total. The statutory rate for corporations in the US is 35 percent; although in practice very few companies pay that much.

In any case, the 25.5 percent is a figure that reflects Apple's global operations, and in many of the territories where it operates the company pays a rate that is far lower.

In 2014 (and this is what caused the recent ill-feeling), Apple is believed to have paid an effective rate - based on approximations of the value that was created there - of 0.005 percent tax in Ireland, where the usual rate of corporation tax is 12.5 percent. That's a rate that is already lower than almost anywhere else in Europe: the UK's corporate tax rate is 20 percent.

Maybe the Irish should be grateful they got even that much. Apple didn't pay any corporation tax at all in the UK in 2012. But more recently things have got a little better here; Mail Online estimates that Apple made £1.9bn of profit in the UK in the year ended September 2014 and paid £11.8m in tax - a rate of 0.6 percent - although it should be emphasised that this figure is based on accountants' estimates of profit generated rather than Apple's own figures, which are vastly lower.

Does Apple pay tax?

How does the maths work? Doesn't Apple have to pay 12.5 percent of its profits in Ireland, and 20 percent in the UK?

It does, but remember that profits are taxed, not revenues. And profits can be quite... flexible.

Like most multinational companies (we'll return to this theme later on), Apple's tax arrangements are complex. By funnelling profits from one territory to another - by such devices as one regional operation paying IP licensing fees to the headquarters in another - it's able to relocate profits to tax-favourable places.

Wired has put together an infographic illustrating some of the manoeuvres the tech giants pull to move profits around Europe. Apple, like most of its rivals, is a practitioner of what's known as the 'double Irish' strategy, where profits are transferred from one Irish company to another; but it gets the profits to Ireland in the first place by buying iPhones from Chinese suppliers through an Irish subsidiary and then selling them on to Apple US at a markup. It's a complicated business.

How can Apple possibly justify paying so little in Ireland?

These days Apple seems to have three ways of communicating with the outside world: large elaborate press conferences, long-form interviews with Tim Cook on US TV, and open letters to customers posted on the company's website. Just as it did when facing off with law enforcement, Apple has addressed the tax issue primarily through a customer letter.

The company's main justifications are threefold. Two of them are standard for large corporations in these situations: those are the rules and we pay every euro cent that we are required to ("In Ireland and in every country where we operate, Apple follows the law and we pay all the taxes we owe"); and nice economy you've got there, be a shame if someone moved their European operations away resulting in the loss of several thousand jobs ("Beyond the obvious targeting of Apple, the most profound and harmful effect of this ruling will be on investment and job creation in Europe… We are committed to Ireland and we plan to continue investing there").

The third is to draw on anti-EU feeling in Ireland related to the country's ability to set its own laws:

"The Commission… is effectively proposing to replace Irish tax laws with a view of what the Commission thinks the law should have been. This would strike a devastating blow to the sovereignty of EU member states over their own tax matters."

And to be fair, by all accounts Apple has broken no rules: the Commission's beef is with the rules themselves, which it believes Ireland was wrong to set, and the special treatment it feels was accorded to Apple. It would be strange to expect Apple to pay more money than it needs to or is asked to by the country where it is based. Remember that it has to justify everything it does to shareholders.

Tim Cook calls the whole situation "maddening" and "total political crap", and said the ruling was "invalid" and "politically based".

"When you're accused of doing something that is so foreign to your values, it brings out an outrage in you, and that's how we feel," he said. "Apple has always been about doing the right thing."

Read next: Wozniak criticises Apple's tax practices: 'It's really not fair' | Senator: Apple 'should win an award', not be chased over taxes

Isn't Apple supposed to be an ethical company?

Yes it is, but the company isn't always completely consistent with this stuff. The way I would put it is that Apple is a company with a social conscience - it has made genuine and substantive contributions to the debates on gun control, lesbian and gay rights and environmental damage in the US, for instance - but on an economic level it's as rapaciously capitalistic as any multinational corporation. It wouldn't be the biggest tech company in the world if it wasn't.

I suspect that on an ethical level, few people in the industry would dispute that Apple - and other tech companies - really ought to pay more tax. There's an element of pragmatism about most arguments in favour of low corporate taxation: a light tax burden makes entrepreneurs more likely to build businesses, create jobs and boost the economy in ways that will benefit the public purse in indirect ways; and a high tax burden makes them more likely to flee to different countries that aren't so strict.

In this context the Commission's ruling makes sense: by obliging its member states to stick to a standardised treatment of multinational companies it could remove the incentive to move elsewhere.

Finally, don't make the mistake of thinking the ethical and moral dimensions are less important than the legal ones. To most companies they might be, but Apple and Apple's PR operations are heavily dependent on its public image and (in most respects well deserved) reputation for integrity. I suspect that the European Commission recognises this.

Speaking to the Wall Street Journal, Jeroen Dijsselbloem, president of the Eurogroup of finance ministers, said: "The Apple response shows that they don't grasp what's going on in society and they do not grasp what's going on in the public debate. This is a very strong moral issue, and large companies, even if they're this large, can't say 'This is not about us, there's no problem here.'"

Does Apple pay tax?

Do other tech companies pay more or less tax than Apple?

Almost uniformly less. Partly because Apple's tax setup is fairly standard practice in this industry, and partly because nobody makes as much money as Apple. The kinds of complex tax manoeuvring that Apple has been accused of are commonplace in the tech industry, and among almost all large corporations.

Offshore Shell Games 2015, a report by the group Citizens for Tax Justice, names 9 tech companies among the 30 firms holding the most money offshore, including Google, IBM, Intel and Microsoft. Between 2007 and 2010, Google is believed to have paid an overseas tax rate of approximately 2.4 percent, according to Bloomberg. This was achieved by routing profits through Ireland and the Netherlands to Bermuda.

Why does the European Commission think Apple should pay more tax?

Mainly it's the inconsistency: the Commission believes that allowing one company to pay lower tax than the usual rate - and particularly on such a grand scale as this - amounts to state aid.

Margrethe Vestager, the European competition commissioner, said: "Member states cannot give tax benefits to selected companies. This is illegal under EU state aid rules."

Apple's letter to customers implies that such deals would have been available for anyone - or the guidance it received from the Irish government before reaching its present arrangement was, at any rate.

Why doesn't Ireland want the money?

On one level there is presumably the fear, aluded to in Apple's public statement, that taxing the company so punitively may cause it to withdraw some or all of its operations from Ireland. But 13 billion euros is a lot of money to leave on the table, simply in order to keep 6,000 people in work. The government could give each of those people a million euros and still have more than half of the money left over.

So why is Apple able to state that it finds itself "in the unusual position of being ordered to retroactively pay additional taxes to a government that says we don't owe them any more than we've already paid"? And why - according to a poll by the Irish Times - do 47 percent of the Irish people believe that their government is right to appeal against a decision that would net them 13 billion euro, against 39 percent who disagree with the appeal?

Well, there are larger questions to ponder. The Irish government is probably concerned that, if it is obliged to make its tax laws more stringent towards large companies, large companies will be less inclined to invest there. So this isn't just about the "nearly 6,000 people" that Apple says it employs in Ireland; it's about all the jobs and tax revenue that will be lost if the tech industry at large changes its mind about Ireland being a convenient and tax-favourable base from which to do business in Europe.

That's the practical aspect, but non-cynics may also feel that Ireland is justified in resisting outside interference in its tax laws.

"The decision leaves me with no choice but to seek cabinet approval to appeal," said Irish finance minister Michael Noonan. "This is necessary to defend the integrity of our tax system, to provide tax certainty to business and to challenge the encroachment of EU state aid rules into the sovereign member state competence of taxation."

Will Apple have to pay its tax bill, or will this be overruled on appeal?

The Irish government is appealing against the ruling, but it's hard to say if they will be successful. Apple says it's very confident.

Margrethe Vestager has offered Apple a glimmer of hope, too - sort of. She says that, if Apple is taxed more heavily in the US, the Commission may be willing to reduce its demands.

"If the US tax authority found that the monies paid due to the cost-sharing agreement were too few... so that they should pay more in the cost-sharing agreement, that would transfer more money to the States and that may change the books and the accounts in the States," Vestager said.