Other countries in the EU, however, can sue ireland for taxes they missed out on. Which is probably what will happen. The money will be divided up over many countries.
On what basis exactly? Income is taxed where the company (Apple subsidiary) is headquartered, so they would have to prove Apple would have chosen a different country, which is not going to happen.