Atop Apple's offshore network is a subsidiary named Apple Operations International, which is incorporated in Ireland but keeps its bank accounts and records in California. Because the United States bases residency on where companies are incorporated, while Ireland focuses on where they are managed and controlled, Apple Operations International was able to fall neatly between the cracks of the two countries' jurisdictions.
Seems rather clever to me...