That's not what happened. The European Commissioner for Competition decreed that Apple had received illegal tax benefits from Ireland and ordered Apple to pay a fine of €13 billion. This was appealed to the European General Court, which ruled in favour of Apple and struck down the Commissioner's decision as illegal.
Apple wasn’t sued or fined and didn’t go to court, the ruling compelled Ireland to collect additional tax from Apple and Ireland was the one who went on and spent tax payer money on appealing the decision in the EGC.