Why? They don't pay taxes, so what's in it for the country to keep them around?
In fact, when you think about it... they force out local companies in the same segment that actually do pay their taxes.
Even further, it is not a given that Apple forced out valuable local companies that have anywhere near the same value. It is not like there was an apple scale technology company in Ireland that was displaced or run out of business.
Even though they do have thousands of employees and even build Macs there, it does seem to be a tax haven.
[1] https://www.apple.com/newsroom/2020/11/apples-cork-campus-ce...
(Note pictures of the infamous Mac Portable, which was apparently manufactured there.)
Ireland does have a history of pulling in investment using tax breaks. Most notably the shannon freezone, where GE and subcontractors produce a large quantity of hardware.
Yet some citizens pay taxes and other benefit.