Lili in posting #3 has a good answer. Those of us, who can afford accountants, can avoid taxes because the tax code is long and complicated. The tax code is long because it has many exceptions that allow people or corporations with income to avoid taxes because they fit somehow into a non-taxed category. Some of the categories are not in the tax code. They exist because of Supreme Court decisions. One decision, we don't remember which one, ruled that federal taxes on income from municipal bonds is unconstitutional, so anyone with income from municipal bonds, like Ross Perot, pays no income tax on that income.
Many of tax loop holes begin as ways to help poor people. We're not sure of the details, but financial people have told us that corporations get tax breaks if their hire certain classes of people, veterans, handicapped people, low income people, etc.
Some tax loop holes exist because the Congress, in its wisdom(?) wants so promote some kind of commercial activity. The famous example is the oil depletion allowance.
For an example of how rich people avoid taxes, see
The Young Phildephians , a movie staring Paul Newman as Anthony Lawrence. In the movie, Lawrence has a client who has property in several states. He reorganizes the assets to decrease the taxes. The movie doesn?t deal with the misfortune of the workers in the states with the higher tax rates. Maybe that might make another movie.