This loophole is simple to setup and follow. All you have to do is to lend your corporation some money. This works as long as you are a shareholder in your company but dont own more than 50% of the stocks. After you lend the company the money, you forgive them the "principal", meaning they dont have to pay you back. This is what is commonly referred to as a tax shelter.
Under this tax shelter, you have contributed money to your company tax-free and if you owned stocks in the company, the forgiven principal increases the cost basis of the stocks that you own. This means that because the purchase price (cost-basis) of your stocks went up, the capital gains tax that you would have paid decreases. According to the books, you make less profit hence you pay less taxes.
The loophole for the company is the one that IRS has been fighting for years without success. The owner who lends money to his company forgives the principal plus the interest on it. This means that the corporation doesnt have to pay the interest but they can report the amount on their tax returns to receive a deduction for it. In turn, this means a huge bite out of your corporate taxes and additional money in the company.