First, here's a little background. If you live in Japan and you buy an iPhone from Apple, that money goes to (who else?) Apple Japan. If you buy apps, movies or music from iTunes in Japan, however, that money goes to a different subsidiary: iTunes K.K. Ah, but there's more: much of Apple's intellectual property is owned by two subsidiaries in Ireland, and other Apple business units around the world pay those entities royalties to use that IP. iTunes K.K. had one such arrangement set up -- when people used the iTunes service to listen to music or watch videos, the subsidiary owed part of its profits to an Apple-owned holding company in Ireland as royalties.

And why Ireland? Well, Apple had a lucrative structure in place that allowed the company to pay hardly anything in corporate taxes on that cash. (Tim Cook, by the way, strongly asserts this isn't true.) Moreover, Apple has never and will never talk about how much those licensing fees are, so they're widely seen as a tool to help keep Apple's money away from the governments who want to collect their share. So, iTunes generates profits in Japan, and Apple ultimately wants it to go to Ireland where it'll barely get taxed. The problem is, Japanese income tax law holds that a Japanese company (like iTunes K.K.) has to pay a roughly 20 percent withholding tax on royalties paid to foreign companies... like Apple's Irish operation. That's no chump change, so the parties involved had to get a little crafty.

iTunes K.K. didn't make royalty payments to Apple's Irish subsidiaries -- it paid them to Apple Japan, the company's other, separate half. Then, Apple's Irish subsidiary sold iPhones to Apple Japan by way of an affiliated company in Singapore. Tokyo's Taxation Bureau alleged that Apple Japan bundled those royalties into the price of the iPhones it was buying so the holding company in Ireland ultimately wound up with the amount the iPhones actually cost plus software profits that never got taxed. Apple kept this up between 2012 and 2014 and moved around ¥60 billion (or about $586.5 million) in the process. Japanese tax authorities wanted -- and reportedly received -- the back taxes on that shifted money, and now the case is closed.

If all of this sounds a little familiar, well, you're onto something. Apple had to pay Italy's tax bureau €318 million (or $348 million) after it was alleged the company underpaid its corporate taxes for six years. Oh, and then there's the whole "having to pay back $14.5 billion to Ireland" thing for creating a tax structure EU regulators have called "illegal." Playing by the rules won't make anyone as obscenely rich as if they hadn't, but man -- Apple is probably getting a little tired of being batted around.

[Image credit: ChinaFotoPress/ChinaFotoPress via Getty Images]