The top executives of Apple faced tough questions today on Capitol Hill. They came at a hearing about Apple's alleged avoidance of billions of dollars in U.S. income taxes. Yesterday, Senate investigators released a study describing how the maker of the iPhone, iPad and Mac computers used subsidiaries based in Ireland to avoid income taxes on a big chunk of its global profits.

As NPR's John Ydstie reports, the hearing highlighted problems with U.S. corporate tax law that create incentives for companies to park profits overseas.

JOHN YDSTIE, BYLINE: The hearing began with Senator Carl Levin, a Michigan Democrat and chairman of the Senate Permanent Committee on Investigations, highlighting the "Alice in Wonderland" nature of Apples subsidiaries in Ireland. The companies fall through the cracks between U.S. law and Irish tax law. As Levin explained, U.S. law says that because the companies are incorporated in Ireland they don't owe U.S. income taxes.

But Irish law says since the companies are controlled by Apple in the U.S., that's where they should be taxed.

SENATOR CARL LEVIN: Apple has arranged matters so that it could claim that these ghost companies for taxes purposes exist nowhere. One has paid no corporate income tax to any nation for the last five years. Another pays tax to Ireland's equivalent to a tiny fraction of one percent.

YDSTIE: The result is that, according to the Senate panel's investigation, Apple avoided paying an estimated $9 billion in U.S. income tax in 2012. Apple CEO Tim Cook took issue with that charge. He said Apple paid more tax than any U.S. corporation in 2012 - $6 billion.

TIM COOK: We pay all the taxes we owe, every single dollar. We not only comply with the laws but we comply with the spirit of the laws. We don't depend on tax gimmicks.

YDSTIE: Cook's last claim surprised another witness, Villanova Law Professor J. Richard Harvey. He first saw the claim yesterday, when Cook's testimony was initially made public.

J. RICHARD HARVEY: I about fell off my chair when I read that. Certainly some of the techniques that Apple uses, you know, could be considered gimmicks. But I'll let the committee decide for themselves whether Apple used gimmicks that resulted in 78 billion of income over four years being recorded in the Irish subsidiary, with no employees for three of the four years and paying essentially no tax.

YDSTIE: But Apple CEO Cook argued his company had paid taxes on the sale of its products in various countries that fed profits into its subsidiary in Ireland. He argued those profits were created in those foreign countries and should not be subject to U.S. taxes. But Senator Levin argued taxes on the profits should be collected in the United States because they were really generated not by the sales of a device but by the intellectual property created by Apple designers and engineers in California.

LEVIN: You point out, and accurately so, Mr. Cook, that 95 percent of the creativity that goes into those products is in California. But two-thirds of the profits are in Ireland. And you've made a decision, which you have a right to do, not to bring that money home.

YDSTIE: Levin charged that Apple sold its intellectual property to its Irish subsidiary simply to avoid U.S. taxes. The Apple executives disputed that. In any case, now, the problem from Apple's point of view, said Cook, is that it's got more than $100 billion in profits trapped overseas.

COOK: Under the current U.S. corporate tax system, it would be very expensive to bring that cash back to the United States.

YDSTIE: That's because Apple would have to pay the U.S. corporate tax rate of 35 percent on every dollar it repatriated.

There was broad agreement from both Democrats and Republicans on the committee that U.S. corporate tax rates, which are among the highest in the world, need to come down and U.S. tax law needs serious reform. If done right, it could change the incentives and encourage U.S. companies to bring earnings from overseas back to the United States. That could create investment and jobs and a more robust U.S. economy.