Edited to add example:
E.g. when Apple sells an iPhone in New Zealand for say $800, they are meant to pay taxes on the difference between what the phone cost and the sales price. Except, all Apple products sold internationally need to pay Apple Sales International for their IP. This amount happens to eliminate the tax liability in every country that they sell products.
So okay, then Apple Sales International should pay taxes on all of that IP licensing cash, right? Well Apple negotiated an agreement with Ireland such that all profits earned outside of Ireland are attributed to a "head office" that literally doesn't exist. So the only taxes that Apple Sales International pay are from sales in Ireland.
So they can make tens of billions in profit, pay a few million in taxes and wait for a repatriation holiday to capture that money basically tax free.