Apple do not have to pay taxes on the billions they choose to amass in Ireland in "every country".
They have to pay them in Ireland where they decided to locate it.
Had they pay the same rate as every other company located in Ireland, that would have been €13 billion over all those years. (Ireland has low taxes, so this is just an hint that Apple Europe is very big).
Instead "Apple paid an effective corporate tax rate that declined from 1% in 2003 to 0.005% in 2014 on the profits of Apple Sales International".
They achieved that using a tax scheme that is on its way to be declared illegal by the international treaties Ireland is part of.
How is that "ridiculously stupid"?