'We're closing in on undeclared income," say the menacing new adverts from Her Majesty's Revenue & Customs (HMRC) that have sprung up on billboards and bus shelters in the past few days.

"If you've declared all your income, you have nothing to fear."

Contrast that with the sight last week of senior managers from Amazon, Starbucks and Google explaining to the Westminster Public Accounts Committee why their companies pay little or no corporation tax in this country. At a time when Bank of England Governor Mervyn King warned of a possible triple-dip recession and credit ratings agency Moody's threw fresh uncertainty over the country's triple-A rating, here was a master class in the inner workings of globalisation.

They certainly took a pasting from politicians playing to the cameras, whose views were later echoed by Business Secretary Vince Cable, but whether they have anything to fear remains to be seen. If John Swinney and the officials setting up Scottish tax collection agency Revenue Scotland were watching, they would have been wondering as much as anyone in Whitehall: is it actually possible to make multinationals contribute more to society?

Starbucks is as good an example as any. The coffee chain turns over nearly £400 million a year in this country from a product that sells to consumers for at least 10 times the wholesale cost. And that's the multiple that would apply if you bought your beans from the local cash and carry and charged way below £3 for a cup.

In Starbucks' case, it owns a subsidiary in Switzerland that buys the beans from coffee growers around the world in the kinds of quantities that mean rock-bottom prices per kilo. Without ever physically taking delivery, this Swiss company sells the beans to Starbucks' roasting houses around the world. In Europe, this means the Netherlands, from where the roasted coffee is then sold on to Starbucks UK. The mark-up that the UK pays compared to what Switzerland pays is 20%.

Chief finance officer Troy Alstead explained to politicians last week that this was the market rate, but it means that the company is charging itself for something that could be obtained more cheaply and making it harder for the UK arm to make a profit as a result. The taxes that the Swiss and Dutch outfits pay on the profits from these sales are way below the UK corporation tax rate, 12% in Switzerland, for example, compared to 25% in the UK.

And this is not the end of the process. The UK company also has to pay royalties for the use of Starbucks' logo, brand and other intellectual property to the tune of some £18m a year. This goes to Dutch and American subsidiaries, which pay an average rate of 16% on the profits. This is no thanks to the Americans, who charge higher rates than the UK, but because of a sweetheart deal between Starbucks and the Dutch government that keeps the company's European headquarters in Amsterdam in exchange for single-digit tax rates. (The UK offers similar deals to other companies.)

Starbucks has also charged its UK subsidiary above-market rates for inter-company loans and offsets against its overall tax bill each year by spending hundreds of thousands of pounds on research and development, among other things. You might have thought there was a limit to how much financial engineering could go into a cup of coffee.

Alstead argued that all Starbucks' in-country retail businesses operated under these terms and that the UK arm had struggled much more than most over its 15-year existence for reasons that included super-high rents in London. But he struggled to explain why senior managers had repeatedly told investors that the UK arm was doing well, and there was no way of hiding the fact that it would be much more profitable without these arrangements in place.

In the cases of Google and Amazon, the low-tax subsidiaries were different but the outcomes were similar. Amazon funnels its UK profits through Luxembourg, Google through Ireland and Bermuda.

"We are not accusing you of being illegal," said committee chair Margaret Hodge as she summed up her colleagues' wrath. "We are accusing you of being immoral."

If this charge is correct, it is one that could be levelled at the majority of big business. Richard Murphy of Tax Research UK, a fierce critic of tax policy, says: "This is pretty much par for the course for multinationals. These American companies are being targeted because it's easier to get the figures for a US company than a UK one. The US have set themselves up to be the fall guys."

The UK companies appear no better. Action Aid last year conducted a study into FTSE 100 companies and found that 98% were using tax havens, with the Scots making bucks with the best of them. Weir Group funnels money through the Bahamas and Cayman Islands, as well as the Channel Islands, where the Glasgow group is joined by the likes of Wood Group and Cairn Energy. Standard Life and Royal Bank of Scotland have subsidiaries in more tax havens than you could shake a stick at.

Many people in the field would argue they have every right. Philip Simpson, an Edinburgh-based advocate and tax specialist at Terra Firma Chambers, says: "It's legitimate and normal. It's absolutely basic tax planning for a multinational group."

He adds: "It's a slightly glib position to say there is something immoral about no corporation tax being paid out of £398m [in Starbucks' case]. Of that money, Starbucks has a big wage bill. Out of that will come income tax, national insurance contributions and employers' national insurance contributions. Starbucks also charges VAT on the products it sells. If it has property transactions, it will pay stamp duty, land tax and so on."

One of the reasons for having a variety of different taxes, according to Simpson, is that the state gets paid one way or the other. Big companies might avoid one tax but they still get embroiled in most of them. He concedes, however, that companies would pay more if they also paid higher corporation tax. Underpinning his argument is a belief that it is essentially the price you pay for having big companies operating here.

As Tracey Bowler, a research fellow at the Institute for Fiscal Studies, says: "If the Government turned around and said to the multinationals that they should be paying a different rate, it would drive away investment from the UK. That's the balance they have to weigh up."

Even if they did invest here, an equal problem is that they would likely pass on any higher costs to their end customers. UK Starbucks customers already pay the price of higher property costs through their coffee, which is 20% above US prices.

These issues do little to placate those on the left campaigning for fairer taxes. They are marshalling perceptions of the so-called tax gap as one of their key arguments against the national austerity programme. They see multinationals as only a high-profile part of a much bigger problem. Further down the iceberg they finger everyone from wealthy tax avoiders like comedian Jimmy Carr to tax evaders such as tradesmen using cash in hand to dodge VAT.

This has led to a huge row within the tax industry as to the actual size of the tax gap. HMRC, which has been publishing figures for three years, reckons it amounts to about £32 billion compared to the £470bn annual tax take. Richard Murphy of Tax Research UK reckons it to be more like £120bn, at least £10bn of which is from multinationals. A recent review of the two sides' arguments by Taxation magazine concluded that the HMRC figure was probably closer to the mark, but everyone agrees there is more that could be done to reduce it.

Murphy contends that a big part of the problem is cutbacks to the size of HMRC. Where in 2004-05 it had 100,000 officials chasing tax, it now has 65,000 and will be down to 55,000 by 2014-15. It has been handed nearly £1bn to try to cut the tax gap by £7bn by that year, but it is having £3bn cut from its budget at the same time – somewhat at odds with the message from the new ad campaign.

Simpson of Terra Firma says that along with the merger of the Inland Revenue and Customs and Excise seven years ago, these cuts appear to have greatly hampered the agency. He finds the quality of customer service poor and says it can take months for tax inspectors to respond to communications. The agency's IT problems are also renowned.

Meanwhile, the Coalition Government is augmenting constant expansions to the tax rules by consulting on a new general anti-avoidance principle. It will mean that more exotic schemes will fall foul if they are against the spirit of what Parliament intended – a rule upon which Labour consulted in 1998 but then dropped. Numerous other countries use similar rules to good effect, particularly Australia, which is seen as something of a poster child for taking on big business in this respect. In another sign of the changing climate in favour of greater tax take, tough rules are also being introduced in the US this autumn aimed at offshore tax evasion.

Murphy does not hold out much hope for the new rule. He believes the current versions of the new anti-avoidance rule are "so inept, so narrowly focused that they would not go near any of the multinationals' schemes and are therefore a waste of time".

Others counter that like in Australia, the rule might gradually be applied more broadly once it is on the statute book. Murphy believes that to curb tax avoidance by big business, the UK should force them to disclose how much tax they pay in each country and push for an agreement between countries over a unitary taxation system that would require companies to pay taxes in line with the share of profits they make in each jurisdiction.

Simpson calls this a "fantasy" that "will not happen in my lifetime or my children's lifetime".

Which might help explain why the three executives before the Public Accounts Committee looked unruffled by the bluster coming from the other side of the table. The anti-austerity movement can take comfort that its case has now reached the mainstream. Reaching a solution is another matter altogether.