Because of complicated tax law, Apple used an interesting tactic to avoid taxes in one case. They set up a corporation in Ireland to hold a bunch of money. Ireland taxes companies based on where you operate. Apple operates out of the US. The US taxes you based on where you incorporate, which was Ireland in this case. So they just didn’t get taxed on the money.