Like the OP, you are badly misinformed. Ten seconds of Googling provided me with the following information from a newspaper article: "[Apple] paid $17.1 billion (€14.6 billion) tax in Ireland [in 2025], which represented 39% of its $43.2 billion of tax payments in the year".
So we can see that (a) Apple does not book "most" of its global revenue through its Irish operation, and that (b) even so, Ireland benefits hugely from having Apple's European HQ located there.