In an ideal world, taxes wouldn't drive business or investment decisions at all. In reality, though, what a company pays or doesn't pay in taxes can mean the difference between a profitable business and a big loser.

That's why tax-saving strategies -- both complicated and simple -- are so important to the bottom line for many companies. Whether it's the company itself dodging a tax bullet or helping its customers avoid paying, tax moves add millions to profits, benefiting shareholders of many companies. The three tax plays below are just a few of the many techniques that have made investors richer over time.

1. The foreign tax dodge
Most people find taxes very complicated. But even among tax professionals, foreign taxation is one of the hardest areas to grasp, because rules and rates differ so much from country to country.

Behind those differences, though, are opportunities to cash in on loopholes. For instance, fellow Fool Morgan Housel pointed to a New York Times article detailing how tech giants Apple (Nasdaq: AAPL), Google, and Microsoft use various foreign subsidiaries to shelter income from the U.S. in its attempt to tax global income for U.S. multinationals. Although those methods come with the downside of trapping money in foreign subsidiaries, the prospects for a tax holiday on repatriated profits similar to the one that Pfizer (NYSE: PFE) and several other pharmaceutical companies took advantage of in 2004 could prove to be the final step to help those tech companies pay rock-bottom effective rates on their income.

Policymakers have floated various answers to the foreign taxation question, such as cutting corporate tax rates or changing the U.S. worldwide tax system to a more nationally centered one. But you can count on multinationals using every legal means at their disposal to minimize their total taxes, no matter what tax system they have to follow.

2. Playing states against each other
Most people focus on federal taxes when they look for tax savings, but arguably the best-known tax-avoidance facilitator helps millions of customers get around state sales taxes. (Nasdaq: AMZN) uses a Supreme Court decision as its basis for not collecting sales taxes in most states, and although customers are responsible for paying equivalent use taxes on the items they buy, it's much less efficient for states to try to go after individual taxpayers than to collect for the big businesses that sell to state residents. States have tried to snare Amazon through its networks of affiliates, but Amazon has in many cases closed those affiliates down rather than risking tax liability.

State taxes go beyond sales tax, though. Big companies can negotiate hugely favorable tax incentives in exchange for job-creating investments in particular states, and so states end up fighting each other tooth and nail for lucrative projects. Especially as state finances are weak, the fight for high-paying, tax-producing jobs will get tougher -- even if it costs millions in business tax revenues in the long run.

3. The plusses of pass-through status
Businesses complain about the high rates on corporate taxes. But as a practical matter, paying corporate tax is largely a voluntary act for most businesses. Simply by setting up shop as a partnership or limited liability company, a business can avoid double taxation and the complexities of corporate taxes.

Businesses of all types take advantage of various provisions to save millions in taxes. Annaly Capital (NYSE: NLY) has earned billions in income over the past several years, but it didn't have to give 35% of those profits to Uncle Sam -- instead, most of that money went straight to taxpayers under the rules governing real estate investment trusts. Similarly, Kinder Morgan Energy Partners (NYSE: KMP) has cashed in on the boom in energy transportation, but its unitholders get the benefit of untaxed distributions from the master limited partnership, which they in turn pay their own individual tax rates on.

May the best players win
Full-scale tax reform has bipartisan support, but the devil's in the details, and it's exceedingly difficult to envision compromise and agreement on any massive tax reform effort. As long as loopholes exist, companies will exploit them -- and the best players will keep earning millions in tax savings for their efforts.

You can use legal tax strategies to your advantage as well. With tax-favored retirement accounts, the ball's in your court -- but you need smart investments for them. Let the Motley Fool's special report on long-term investing give you some great ideas on stocks that will serve you well over the years. Click here and get your free copy right now.