"Tax optimization" should be considered a crime. I like how those big companies take advantage of the infrastructures of the countries there are based at, but manage to pay almost no tax in return, only because they can hire experts who find them ways of doing so.
The biggest companies, like BMW, Google, Coke, and basically everyone does that... It's beyond desguisting
That's not true. Not even a little bit.
Profits are allocated to every country a business does business in. A company like Google probably performs sales and marketing most European countries but some don't produce the same levels of profit as others.
Generally speaking, the profit margin for "routine" sales and marketing activities is somewhere between 2 to 5 percent of sales. Therefore, if a company is earning a much greater return (say 10 percent) in one country, it is reduced through the movement of money to the IP owner (the Irish company). However, the flip side is true.
If a company is unprofitable (-10 percent return), the IP owner pays the company money to bump them up to a 5 percent return so that they can pay taxes in that country.
It would take 20 seconds to come up with a tax strategy where a very profitable company can allocate profits and losses around the world and end up in a situation where their net tax bill would cause them to get a large refund. Those instances are outlawed. What we have today is a system where you prove that the returns are appropriate in each country based on the functions and risks in each country.
What you end up with is a system where small sales offices will ALWAYS pay taxes in their country of operation and the IP owner (probably a combination of a non-resident Irish, Netherlands, or Singapore company, and the main company) will get refunds when the the company loses money overall but pay taxes when the company is profitable.
You are wrong to say that these companies are using the infrastructure of a company but don't pay taxes. It's the fairest system anyone has yet conceived to manage issues like the taxation of multinational companies.