Re: What I don't get...
They key thing to remember is that it is profits which are taxed. If a company has a widget which sells for £1000 but costs £999 to make then they would be charged the same amount of tax as a company which sells a widget for £10 which costs £9 to make. This is probably the right way to do it, why should we penalise companies who need a lot of costly materials to make their products.
The difficult part is determining what the cost of making the widget is, it doesn't just include the time and materials (£3), but other things such as the design and prototyping costs (£3), paying the purchasing department (£1), the marketing effort (£1), the brand development (£1) etc.
Some of this work is done by employees in other countries (working for other subsidiaries), obviously you can't just ignore the cost of the work done by the purchasing department in Switzerland, so "transfer pricing" is used for the UK subsidiary to pay the Swiss subsidiary a 'fare' price for the work they do. If the fair price is £2 not £1 then suddenly no profit is made in the UK and tax is no longer due.
Companies like arranging it so that low tax countries happen to receive a higher 'fare' price than high tax countries, through basing hard to price intangible items such as the brand name 'Starbucks' in those countries. The name obviously has value, and costs associated with developing and maintaining that brand, so some payment is fair, but how much? This is what most of the tax fights are over - what is the fair amount of tax to be paid.
Apple/Ireland went a step further by saying there was a company headquarters and almost all the work done by that company was done by the headquarters (even though it had no staff or premises) and in fact wasn't even located in any country. The Irish government went along with that due to the fact jobs were being created and they'd at least be able to tax the wages, the EU has said this arrangement is clearly bogus and effectively state aid in order to bribe apple to make those jobs.
All in all trying to make it work fairly with big multinational companies is hard - however you frame your tax laws will almost certainly have winners and losers.