Let's say I have a company that sells gravel in Canada. I buy gravel wholesale for $500 per ton then sell it retail at $1000 a ton. I make approximately $500 per ton in profit. That means I would have to pay corporate tax on the $500 per ton in profit (assuming I had no other costs). What if I set up an offshore subsidiary (e.g. Cayman Islands) that buys the gravel from my supplier for $500 per ton then sells it to me for $1000 per ton and then I sell it to the customer for $1000 per ton? If that were possible, I'd effectively shift the profit I make from gravel sales from Canada to a no-tax offshore country and thus escape corporate tax while still making just as much money (and if I had any other costs, I'd then have a loss that I could apply to past year's gains).
"Transfer pricing" is the term given to the price set between related entities (e.g. a Canadian company and its Cayman Islands subsidiary). The rules for how companies can set their prices internally are complicated but attempt to stop would-be tax cheats from moving profit from one country (that has taxes) to another country (that doesn't, or has very low taxes). A key principle is that the price that a company should pay to its subsidiary is the price that they would pay an "arms-length" company. This principle is hard to apply and the rules create opportunities to pay very little tax on very large sales.