That's generally what each country does to the companies operating inside it.
But here's the problem. Lets say an iPhone costs $400 to make, and sells retail for $1000. One Apple-related company pays $400 to get the phone made in china, and then sells the phone to Apple Ireland. Apple Ireland pays $450 to get the phone, then sells the phone for $995 to Apple Australia or Apple USA or whatever. Australia/USA can tax the profits of the local company, but the local company only made $5 per phone, and then used most of that for local expenses/advertising. Apple Ireland books most of the profit, and at a tax rate far less than other Western countries.