Apple has 137,000 employees of which 80,000 are in the United States and 22,000 are in Europe, and of those 6,000 in Ireland. However, 64% of Apple's sales are (or at least were in 2017) outside the US, which then get funneled to Ireland, despite only housing like 4.3% of Apple's global employees.
They're just shifting money, not talent. Money which is then taxed at a very low rate (Apple International had an effective corporate tax rate of 1% in 2003, which was shrunk down to 0.005% by 2014) and in return doesn't really benefit the people of that country.