Europe's highest court has overturned a case against the coffee giant Starbucks which was accused by the European Commission of enjoying illegal state aid through a sweetheart tax deal.

However, in another eagerly awaited case, the European Court of Justice found that the car manufacturer Fiat Chrysler did enjoy preferential tax treatment from the Luxembourg authorities in a way that breached state aid rules.

Both cases will be closely watched for any bearing they might have on the Apple case, which is currently being appealed by both the tech company and the Irish Government.

That case also deals with whether the tax arrangements struck between a member state and a large multinational amount to illegal state aid.

This morning in the Starbucks case, the General Court of the ECJ ruled that the commission was unable to establish that the global coffee giant enjoyed a clear economic advantage due to the tax arrangements it had made with the Netherlands.

In 2015, the European Commission held that tax arrangements involving Starbucks and one of its subsidiaries amounted to illegal state aid.

The investigation related to a deal struck between Starbucks and the Dutch authorities called an Advance Pricing Arrangement (APA).

It determined how much Starbucks Manufacturing earned in terms of what it produced within the overall Starbucks group and what its distribution activities were.

Those earnings determined what its annual taxable profit was under the Dutch corporate tax rate.

The tax deal also endorsed the amount of royalties paid by Starbucks Manufacturing to another entity within the same group.

That entity, known as Alki, sold to Starbucks Manufacturing the rights to use its brand of roasting, which was regarded as a form of Intellectual Property.

The tax arrangement essentially meant that the amount of the royalty to be paid to Alki corresponded to Starbucks Manufacturing's residual profit.

The amount was determined by deducting Starbucks’s earnings, calculated in accordance with the tax arrangement, from its operating profit.

The European Commission believed that this gave Starbucks a selective advantage over other companies and amounted to illegal state aid.

Both the Netherlands and Starbucks had argued that under the so-called "arm’s length principle" the commission did not have the competence to adjudicate the tax arrangements.

This is because taxation remains a national competence under EU law.

However, the ECJ ruled that the commission did have the powers to investigate if taxation arrangements between different entities of the same group were used in a way that would not be legal in normal market conditions and where stand-alone companies were concerned.

The European Commission had argued that Starbucks had used the wrong methodology to work out how much royalties were owed by Starbucks to Alki and that if the proper methodology had been used, the price of the royalties would have been zero, thus reducing the amount the company could offset against tax.

Furthermore, the commission argued, Starbucks had overpaid when purchasing coffee beans, effectively in order to reduce its tax burden.

On the first point, the court held that simply by using the wrong methodology did not mean the company was necessarily able to reduce its tax burden.

Nor did the use of methodology run counter to the arm’s length principle, the court held.

The commission also failed to demonstrate that the level of royalties that should have been paid by Starbucks to Alki amounted to zero, the court concluded.

The court ultimately concluded that the commission had not been able to establish that Starbucks had enjoyed a selective advantage over other companies in a way which breached the EU’s state aid rules.

The Fiat Chrysler case related to tax arrangements struck between the company and the Luxembourg tax authorities in September 2012.

The so-called "tax ruling" was granted to Fiat Chrysler Finance Europe (FFT).

This was an entity that was part of the overall Fiat group, which provided treasury and financing services to subsidiaries throughout Europe.

The tax deal endorsed a method for determining FFT’s earnings for these services.

The deal meant FTT could determine its taxable profit on a yearly basis in Luxembourg, rather than elsewhere in Europe.

In 2015, the commission concluded that the deal amounted to illegal state aid, and that Luxembourg had not notified it of the arrangement.

The commission then ordered Luxembourg to recover the aid from FTT.

Both Luxembourg and the company appealed the decision on the basis that the commission had been attempting to bring about "tax harmonisation in disguise" and that the case was against the "arm’s length principle".

The plaintiffs also disputed the commission’s view that the tax arrangements restricted competition and trade between member states.

However, this morning the General Court held in favour of the commission’s case against Fiat Chrysler and the Luxembourg authorities.

The court found that the commission did not engage in "tax harmonisation" but simply exercised its powers under EU law.

This was through attempting to verify whether the tax deal gave the company an advantage that stand-alone companies would not enjoy under "normal" taxation.

The court also found that the pricing of intra-group transactions was "not determined under market conditions."

In other words, the commission was entitled to explore whether the taxing of such activity would have also applied in normal market conditions where stand-alone companies were involved.

The commission was therefore right to compare the fiscal burden in intra-group situations with a "normal" market situation where stand-alone companies were concerned and the same fiscal measure applied.

The court ruled that the "arm’s length principle" still allowed the commission to check that intra-group transactions were remunerated as if they had been negotiated between independent companies.