The situation is complicated. There actually is no "EU tax"--each member of the EU sets its own tax policy. This is similar to state tax regimes in the United States, and it creates a similar situation: some EU countries compete for business revenue by trying to make their tax systems kind to business.
Ireland, a little nation on an island far away from the rest of the EU, has decided that they will attract businesses by offering very low tax rates. Apple obliged them and based their European business in Ireland.
BUT, the EU requires that each member nation "play fair" in how it subsidizes national businesses. The kerfluffle over Apple's Irish tax bill is because the EU competitiveness committee has ruled that Ireland's low taxes are equivalent to an unfair subsidy. But the key point is that it is Ireland's rate, which is why Ireland is also fighting the EU ruling. If they can't have lower-than-average business tax rates, they might have a harder-than-average time attracting businesses.
U.S. federal taxes apply to ALL U.S.-based businesses, and apply to their global business (unlike every other national tax regime in the world). So--since Apple is a U.S.-based business, they cannot avoid federal taxes if they bring profits home the U.S.
Apple cannot realistically expect to get more than a marginal improvement in the U.S. federal rate, because there is not competition with the federal government for setting that rate. So they store their profits outside the U.S., hoping the rate goes down in the future.