Alongside the results of last week’s US midterms came the passing of San Francisco’s Proposition C, a measure that will tax firms with an annual turnover of more than $50m (£44m) to raise an estimated $300m extra a year to help address homelessness. Last Tuesday, 60% of voters backed it: though the proposal is now snarled up in a constitutional dispute, its approval marks a big moment for a city whose housing crisis has become a matter of urgency.

Given the huge concentration of technology giants in San Francisco, the debate quickly became a drama about big tech and its social responsibilities. The most high-profile supporters of the plan included Marc Benioff, the founder and CEO of the software company Salesforce, the single largest employer in the city, who donated $8m to get it on the statute book. He and his fellow campaigners were opposed by a gaggle of high-ups from such companies as Twitter, the ride-hailing giant Lyft, and the online payments service Stripe: wealthy people apparently doing their bit to resist a modest boost in help for the most vulnerable, in a place whose homelessness problem is at least partly traceable to the vast increases in property values caused by big tech’s local dominance.

Such moves – joined last week by comparable tax plans in Palo Alto and Mountain View – add to the noise around two connected questions. The first is obvious: what do we do about the corporations that are driving huge social and economic change, but have so far proved reluctant to pay anything approaching their fair share of tax? From that follows the second, even graver conundrum: if things stay as they are, what could happen to just about everything that depends on government funding?

Clearly, an aversion to being taxed is hardly unique to tech companies. But in the ways digital communication and commerce operate, there lies an abundance of opportunities for light-footed firms. When you use Facebook or Google via servers that might be located in any number of places, where is the economic activity to be taxed located? In the absence of any clear answer, the tech giants have spun huge webs of obfuscation: subsidiaries that superficially trade with each other, hefty “administrative expenses”, tax discounts from employee share schemes, and holding companies based in low-tax jurisdictions such as Luxembourg, Jersey and the Cayman Islands. A patina of liberal piety – Google’s unofficial motto “Don’t be evil”, and all that – plays its part in obscuring what has been going on. So too does the endless competition between countries and cities desperate to attract tech businesses, something recently glimpsed in the unseemly spectacle of US cities offering Amazon generous tax incentives, as they competed to become the home of the company’s second HQ.

‘Facebook, Google, Apple, Microsoft and Cisco generated UK profits of £6.6 bn, but paid tax of £191m – as opposed to the £1bn Taxwatch says they ought have contributed.’ Photograph: Jeff Blackler/Rex/Shutterstock

Every week now brings another proposal to somehow start to address all this, and a sense that most of what has so far been suggested falls short. Philip Hammond’s budget contained the very modest proposal to take 2% of the UK revenue from tech companies with more than £500m of global income – which, it’s estimated, might bring in as little as £30m per company. Spain is about to introduce something comparable, and apparently slightly more ambitious. In Brussels, the EU is currently tangled up in an ongoing mess about a similar proposal, driven by the French president, Emmanuel Macron, but opposed by such countries as Denmark, Sweden and Ireland.

According to analysis by the financial services company Standard and Poor’s, between 2007 and 2015 the average effective rate of tax paid in the US by the country’s 500 highest-valued firms was put at 27%. By contrast, over the same period, Apple paid 17% of its US profits in tax, Alphabet (Google’s parent) paid 16%, Amazon paid 13%, and Facebook paid just 3.8 %. In 2017, Amazon’s US profits were more than $5.6bn, yet it paid almost no federal income taxes, partly thanks to “excess stock-based compensation deductions” .

Outside the US, the disparities between takings and tax are even more glaring. In 2016, Apple paid $2bn of tax on $41bn of profits generated elsewhere, an effective rate of 4.8%. This year, a report by the new thinktank Taxwatch dug into the mess of complexity that surrounds the UK tax affairs of some of the biggest tech firms. Facebook, Google, Apple, Microsoft and Cisco, it said, generated UK profits in 2017-18 of more than £6.6bn, but paid a combined tax bill of £191m – as opposed to the £1bn Taxwatch says they ought to have contributed. In the same period, Airbnb paid a mere £600,000 in corporation tax, and questions have been asked (but not yet answered) about whether Uber should be charging VAT on its booking fees and paying it to HMRC. Meanwhile, the branch of Amazon that runs its UK fulfilment centres paid £1.7m in taxes, despite declared profits of £72m. The companies insist they abide by tax laws and pay the amounts due from them.

‘Big tech is reshaping societies and economies at speed – think of what Amazon is doing to our high streets.’ A ‘fulfilment centre’. Photograph: Matt Cardy/Getty Images

The upshot is obvious: while big tech is reshaping societies and economies at speed – think of what Amazon is doing to our high streets or, looking ahead, the huge disruption that could be sown by driverless transport – it gives woefully inadequate financial help to the governments whose job it is to manage the fallout. The problem is compounded by the fact that, almost by definition, tech companies do not spread their wealth via employment – and, as consequence, income tax – to anything like the extent that traditional firms once did.

The beginnings of an answer might lie in what economists call a unitary tax. In this model, firms would be obliged to give the tax authorities of any country in which they operate both a set of accounts for their global activities and information about their physical assets, workforce, sales and profits for the territory in question. Tax would then be decided using a formula based on these factors. Some state taxes in the US work on a comparable basis, and the European commission has made supportive noises about the concept.

What stands in the way is obvious: a unitary tech tax would have to attract a reasonable measure of international consensus, otherwise tech firms might move their operations to countries that spurned it. Certainly, at a time when globalism is being trumped with a capital T (the US president, let’s not forget, has already cut corporate tax from 35% to 21%, and wants to hack it down to 15%), the idea would need a massive popular push to stand even a small chance of success.

In the context of Britain, that inevitably brings us to the politics of Brexit, and how well the light-touch, low-tax dystopia promised by its advocates on the right would suit the kind of multinational giants already lobbying governments to leave things as they are. Herein lie the politics of tomorrow, and the reason why comparatively parochial arguments about how much income tax to charge “the rich” slightly miss the point. Make no mistake: very soon, whether or not big tech’s tax gap is closed may well mark the difference between a viable future, and a very modern nightmare.

• John Harris is a Guardian columnist