European Union officials announced Tuesday morning that they are ordering Apple to pay $14.5 billion (technically €13 billion) in back taxes plus interest (another €6 billion) to the government of Ireland.

That’s big news. What makes it weird is the Irish government is appealing the decision, saying they don’t want Apple’s money.

That’s a story, in part, about the exciting world of European Union corporate taxation policy. It’s also very relevant to the growing American practice of highly profitable companies stashing profits overseas to avoid taxation.

And at the center of the drama is Margrethe Vestager, the EU’s commissioner for competition, who also happens to be the real-life basis for Birgitte Nyborg, the main character on the Danish TV series Borgen that’s developed something of a cult following.

What happened here exactly?

Ireland is a member of the European Union, which operates something known as the single market, allowing companies based anywhere in the EU to seamlessly sell goods and services to other countries in the EU. This single market means that many regulatory issues and other important government functions are handled at the EU-level, through the Union’s permanent bureaucracy in Brussels.

Taxation, however, is handled by the individual member states, and they vary considerably in their policies toward corporate income taxes.

Many global companies take advantage of this combination of single market and diverse corporate taxation by choosing to legally locate their European operations in Ireland, which has a low corporate income tax rate. With the Irish headquarters in place, the name of the game is then to use some clever lawyering and accounting to ensure that even if the bulk of your European sales occur in Germany, France, Italy, and Spain, the bulk of your European profits occur in Ireland, where they are taxed at the low Irish rate.

EU authorities, however, allege that something even bigger was going on with Ireland — a special tax deal similar to deals the EU has already challenged between Amazon and Luxembourg and Starbucks and the Netherlands.

The theory here is that Apple and Ireland (or Amazon and Luxembourg, or Starbucks and the Netherlands) basically negotiated an arrangement in which the company just agreed to hand over a certain amount of money and then the government agreed to say the company has fully exercised its European tax obligations. This means Ireland gets to artificially inflate its tax revenue while Apple artificially reduces its revenue, by ensuring that no taxes at all are paid to other European states.

Why is this handled by the competition commissioner?

The European Union does not have a unified taxing authority.

But it does have a unified anti-trust agency, run by the competition commissioner. This is a very important agency because, by tradition, busting up national monopolies and ensuring continent-wide competition was one of the primary missions of the European Union.

As part of that, the EU attempts to restrict member states from subsidizing particular companies.

The specific fear was that the government of, say, France would direct subsidies to France-based automobile companies like Peugeot, thus unfairly disadvantaging Fiat unless Italy also stepped up with subsidies. Consequently, this kind of state assistance to firms is considered anti-competitive under EU law.

But in recent years, Vestager and her competition commission have interpreted favorable corporate income tax deals as a form of illegal subsidy. She says that due to its arrangement with the Irish government, “Apple only paid an effective corporate tax rate that declined from 1% in 2003 to 0.005% in 2014 on the profits of Apple Sales International.”

This, she says, is “illegal under EU state aid rules, because it gives Apple a significant advantage over other businesses that are subject to the same national taxation rules.”

Why are the Irish saying they don’t want Apple’s money?

The Irish government would, of course, be glad to enjoy a $14.5 billion tax revenue windfall.

Their concern, however, is that taking the money could end up killing the goose that laid the golden egg. Ireland is a small country, with about 4.5 million inhabitants*; it’s a little bit remote; and historically it’s traditionally been a bit of an economic backwater.

That changed in recent decades thanks to Dublin’s booming business as a host for corporate headquarters. It’s a nice town located in a very pleasant country whose population speaks English and is well-educated. It’s a perfectly viable place to do business, in other words, and its 12.5 percent corporate income tax makes it an unusually lucrative place to book profits. Given the country’s small population, even if these foreign HQs don’t really employ very many people or generate that much economic activity relative to the overall scale of the enterprises, it amounts to a lot of extra money relative to the scale of Ireland.

But while this arrangement is very convenient for foreign companies — especially high tech and pharmaceutical companies that own a lot of patents and can engage in a lot of fancy accounting footwork to locate profits wherever they like — it’s deeply annoying to some of Ireland’s fellow EU member states, who see the country as making a living as a parasitical tax haven.

Technically speaking, the EU ruling on the Apple matter doesn’t prevent Ireland from continuing to make tax competition the basis of its economic strategy. But the broad implication is that the EU is looking at using competition law as a basis for forcing member states to begin applying corporate tax law in a more uniform way. That’s a clear and present danger to Ireland’s overall economic approach, so the Irish are pushing back.

What does this have to do with Apple avoiding American taxes?

The bad news for an American company that’s reached a convenient arrangement with a low-tax foreign company is that the American government collects corporate income tax on a global basis. If you are an American company, you owe taxes on all your profits, wherever the profits are earned. You can take a credit for whatever taxes you pay to foreign governments, so there’s no double taxation. But saving a bundle by locating in low-tax Ireland doesn’t actually save you any money, it just increases what you owe to Uncle Sam.

Except there’s a loophole.

You are allowed to “defer” paying taxes on your foreign profits as long as that money is still owned by your foreign subsidiary. The theory is that you might end up using the money to finance a foreign investment next year or something, so it shouldn’t really be taxed.

The reality is that big, highly profitable American firms are deferring taxation on over $1.4 trillion of dollars of profits that they clearly have no intention of ever using to finance investment. What they’re doing is hoping that Congress will change the law and allow that money to be repatriated at a lower rate. When that happens, the money will be paid out as dividends and share buybacks.

But until then, Apple and other global companies taking advantage of the loopholes are tapping the bond market and going into debt to finance their buybacks even while accumulating cash in foreign accounts.

* Correction: An earlier version of this article misstated the population of the Republic of Ireland as 6.4 million. That is the approximate population of the island of Ireland, but some of those people live in Northern Ireland which is a region of the United Kingdom and not part of the country that this article is about.