On 7 October 2002, an Anglican priest, William Campbell-Taylor, and an English-Jewish academic, Maurice Glasman, came to the law lords to challenge a parliamentary bill. It was the start of an episode that anyone worried about tax avoidance - or, for that matter, about the fate of the NHS, about economic inequality, about student loans, about capital flight from Africa, about global financial deregulation or about the political might of the financial sector - ought to know about. Yet there was little media interest.

The bill concerned the City of London Corporation, the local-government authority for the 1.2-square-mile slab of prime real estate in central London that is the City of London. The corporation is an ancient, semi-alien entity lodged inside the British nation state; a "prehistoric monster which had mysteriously survived into the modern world", as a 19th-century would-be City reformer put it. The words remain apt today. Few people care that London has a mayor and a lord mayor - but they should: the corporation is an offshore island inside Britain, a tax haven in its own right.

The term "tax haven" is a bit of a misnomer, because such places aren't just about tax. What they sell is escape: from the laws, rules and taxes of jurisdictions elsewhere, usually with secrecy as their prime offering. The notion of elsewhere (hence the term "offshore") is central. The Cayman Islands' tax and secrecy laws are not designed for the benefit of the 50,000-odd Caymanians, but help wealthy people and corporations, mostly in the US and Europe, get around the rules of their own democratic societies. The outcome is one set of rules for a rich elite and another for the rest of us.

The City's "elsewhere" status in Britain stems from a simple formula: over centuries, sovereigns and governments have sought City loans, and in exchange the City has extracted privileges and freedoms from rules and laws to which the rest of Britain must submit. The City does have a noble tradition of standing up for citizens' freedoms against despotic sovereigns, but this has morphed into freedom for money.

A few examples illustrate the carve-out. Whenever the Queen makes a state entry to the City, she meets a red cord raised by City police at Temple Bar, and then engages in a col­ourful ceremony involving the lord mayor, his sword, assorted aldermen and sheriffs, and a character called the Remembrancer. In this ceremony, the lord mayor recognises the Queen's authority, but the relationship is complex: as the corporation itself says: "The right of the City to run its own affairs was gradually won as concessions were gained from the Crown." The modern ceremony strikingly marks the political discontinuity at the City's borders.

The Remembrancer, whose position dates from the reign of Elizabeth I, is the City's official lobbyist in parliament, sitting opposite the Speaker, and is "charged with maintaining and enhancing the City's status and ensuring that its established rights are safeguarded". His office watches out for political dissent against the City and lobbies on financial matters. Then there is the City's Cash, "a private fund built up over the last eight centuries", which, among many other things, helps buy off dissent. Only part of it is visible: the Freedom of Information Act applies solely to its mundane functions as a local authority or police authority. Its assets are beyond proper democratic scrutiny.

The City Corporation is different from any other local authority. Here, hi-tech global finance melds into ancient rites and customs that underline its separateness and power with mystifying pomp. Among the City's 108 livery companies, or trade associations, you will find the WorshipfulCompanies of Loriners (concerned with stirrups and other harnesses for horses) and Fletchers (arrow-makers) as well as the Worshipful Company of Tax Advisers, among whose four prime aims is "to support the Lord Mayor and the City of London Corporation", and the Worshipful Company of International Bankers, whose heraldic "supporters" are the griffins, guardians of treasure.

The carve-outs that the City's grandees have created are astonishing. One of the biggest relates to the bill that came before the law lords on a chilly day in October 2002. Sitting in the Café Churchill on Parliament Street, Glasman used sugar sachets and teaspoons to reconstruct the scene for me. Apart from a couple of brave, independent-minded Labour MPs, notably John McDonnell, nobody supported Glasman and Campbell-Taylor to challenge the bill. Such is the fear that the corporation inspires in parliament.

Campbell-Taylor - a handsome and articulate Oxbridge-educated priest - probably felt more at home than Glasman in front of the assorted City scriveners, aldermen and barristers. Glasman has thick, tousled black hair, horn-rimmed glasses and an easy, slightly dishevelled charm. Born in 1961, a grandchild of eastern European refugees from the Holocaust, he was educated at a rough north London comprehensive but won an exhibition to read history at Cambridge. He bunked off lectures, took up the trumpet and joined a band, the Ashtrays, though the big break never came. "I had to do a reckoning with who I was," he told me. "I thought for a long time that it was women I was interested in. But I was having a lot of anxiety: I thought it was because I was with the wrong women. Eventually I realised it was political work and academic engagement that made me happy. I had made a simple category error."

He took on various academic posts and wrote a book called Unnecessary Suffering, about the Solidarity movement in Poland. In 1995, he took a job at Guildhall University, where he made friends with Campbell-Taylor, the chaplain. Campbell-Taylor first properly encountered the corporation through a campaign called Spitalfields Market Under Threat (Smut), confronting a property development on the fringes of the City. They were astonished to find that the corporation was a big shareholder in the development - a public authority acting as a private company, outside its jurisdiction. They resolved to find out more. Campbell-Taylor got himself elected as a City ward councillor, running on a campaign to save a school. Once inside, he discovered the matter that would take him to the law lords.

The slavery franchise

Over the centuries, reformers in Britain have tried, and failed, to have the corporation merged into a unified London authority. The political landscape heaved and shifted around it, but the City stood immune. As the Times noted in 1881, "The City Corporation is sacred although nothing else is."

For much of the 20th century, the Labour Party had a pledge in its manifesto to abolish the corporation. In 1917, Peter Mandelson's grandfather Herbert Morrison, a rising star in Labour ranks, put the party's antipathy plainly. "Is it not time London faced up to the pretentious buffoonery of the City of London Cor­poration and wipe it off the municipal map?" he asked. "The City is now a square mile of entrenched reaction, the home of the devilry of modern finance."

Clement Attlee took up the baton in 1937. "Over and over again we have seen that there is in this country another power than that which has its seat at Westminster," he said. "Those who control money can pursue a policy at home and abroad contrary to that which has been decided by the people." Freedom for money can lead to bondage for ordinary people. Labour never did abolish the corporation; instead, the Greater London Council was abolished in 1986 under Margaret Thatcher. In 1996, Tony Blair got Labour to replace its pledge to abolish the corporation with a promise merely to "reform" it. This was the suggestion before the law lords in 2002 - and it was an astonishing gift to the corporation.

Like any other local authority, the City of London is divided into wards. These elect candidates to serve on the Court of Common Council, the City's principal decision-making body. Unlike any other local authority, however, individual people are not the only voters: businesses can vote, too. Political parties are not involved - candidates stand alone as independents - and this makes organised challenge to City consensus all but impossible.

Before 2002, the 17,000 business votes (only business partnerships and sole traders could take part) already swamped the 6,000-odd residents. Blair's reforms proposed to expand the business vote to about 32,000 and to give a say, based on the size of their workforce in the Square Mile, to international banks and other big players. Voting would reflect the wishes not of the City's 300,000 workers, but of corporate managements. So Goldman Sachs and the People's Bank of China would get to vote in what is arguably Britain's most important local election.

The City called the reforms "radical change that is essential to keep a world-class financial centre". Glasman called it the "biggest retrograde step since Magna Carta". These workers did not have control of their own votes - the reform programme was comparable, he said, to the voting rights of chattel owners in the pre-war American South: the slavery franchise.

When the reforms came before the Lords, Tom Simmons, chief executive of the corporation, outlined the heft and the outlandish nature of this primeval quasi-British institution. "The corporation emerged from a 'missed time' and there is no direct evidence of it coming into existence," he said. "There is no charter that constituted the corporation as a corporate body." City people joke that it dates its "modern period" from 1067, the year when William the Conqueror "came friendly" to the City and let it keep its ancient rights as he subdued the rest of the country.

This "missed time" is significant, Glasman says, because it means the City's rights pre-date the construction of modern political Britain, and this has placed it outside parliament's normal legislative remit. The City evolved as an institution not so much subordinate to parliament, or the church, or the Crown, but adjacent to and intertwined with them in complex relationships. It is the carve-out again.

The offshore City

The corporation's part-escape from Britain is just one element of the offshore story. It is no coincidence that the capital of what was once the world's greatest empire - with the City as "governor of the imperial engine", as the historians P J Cain and A G Hopkins put it - has become the centre of a big part of the modern global offshore system.

As my book Treasure Islands describes in detail, the Bank of England, lodged in the heart of the City (but not, it has to be said, regulated by it), in effect encouraged tax havenry in British outposts of the Caribbean and elsewhere. By the 1980s, the City was at the centre of a great, secretive financial web cast across the globe, each of whose sections - the individual havens - trapped passing money and business from nearby jurisdictions and fed them up to the City: just as a spider catches insects. So, a complex cross-border merger involving a US multinational might, say, route a lot of the transaction through Caribbean havens, whose British firms will then send much of the heavy lifting work, and profits, up to the City.

The Crown dependencies of Jersey, Guern­sey and the Isle of Man, which focus heavily on European business, form the web's inner ring. In the second quarter of 2009, Jersey alone provided £135bn in bank deposits upstreamed to the City. Jersey Finance, the tax haven's promotional body, puts the relationship plainly: "Jersey is an extension of the City of London."

The next ring of the web contains the British overseas territories, such as the Cayman Islands and Bermuda. Like the Crown dependencies, they have governors appointed by the Queen and are controlled by Britain in myriad ways, but with enough distance to allow Britain to say "There is nothing we can do" when it suits.

The web's outer ring contains an assortment of havens, such as Mauritius in the Indian Ocean, Hong Kong and the Bahamas, which Britain does not control but which still feed billions in business to the City from around the world.

So, the corporation has two main claims to being a tax haven: first, as a semi-alien entity, floating partly free from Britain (just as the Cayman Islands are), and second, as the hub of a global network of tax havens sucking up offshore trillions from around the world and sending it, or the business of handling it, to London. These are possibly the biggest reasons for the City's wealth and power - yet how many Britons understand this?

“Don't tax or regulate us or we'll move to Switzerland," the bankers and hedgies cry; and all too often the politicians quail and cut taxes on the wealthy, deregulate finance further, and hand yet more freedoms to the City.

Nearly every multinational corporation has offshore subsidiaries (not counting those in Lon­don) - and the biggest users of offshore finance are banks. Financial Mail recently counted over 550 offshore subsidiaries just for Barclays, RBS and Lloyds - each of which far outstrips any other multinational. This isn't just about tax: banks go offshore to escape certain financial regulations, and can grow faster as a result. So, offshore is a big part of the Too Big To Fail story - another element strengthening the City's power through the grip these banks have on our elected leaders and boosting the breathtaking chutzpah of the Barclays chief executive, Bob Diamond, who told the UK Treasury select committee on 11 January that he didn't know how many offshore subsidiaries his bank had, and that the "period of remorse and apology" for banks should now end.

The corporation loves financial deregulation - globally. Deregulation is a bit like shaking (or, perhaps more accurately, removing a net from) a tree full of insects: the more you do it, the more business floats around, ready to be caught in the nearby web. As such, it is hardly surprising that the Lord Mayor of London is evan­gelical about it. In fact, his role is officially, as the City explains, to "expound the values of liberalisation" and provide "support for innovation, proportionate taxation and regulation". (On his 20-odd foreign trips a year, he makes clear that "proportionate" means "limited".) Not only that, but the Lord Mayor and colleagues promise to "take up cudgels on behalf of the City anywhere in the world on any subject which is of concern to the City".

Thus, the role of the City of London Corporation as a municipal authority is its least important attribute. This is a hugely resourced international offshore lobbying group pushing for international financial deregulation, tax-cutting and tax havenry around the world.

Divided capital

In the end, the bill on extending the corporate vote passed, carried on a Labour majority. Glasman's and Campbell-Taylor's challenge failed, although they won a small victory - that the process for choosing business electors be "open and clear". Campbell-Taylor now works in a small parish in north London; Glasman has risen from relative obscurity to become a leading thinker for the Labour Party - and was recently ennobled for this by Ed Miliband.

It is easy to be daunted by the City and the offshore system. Some reviewers of Treasure Islands were so disturbed by the scale of it - Peter Preston's defeatist review in the Guardian is a case in point - that they advocated, in effect, capitulation. Given that the financial services sector has just been exposed as having provided over half of the Conservative Party's funding last year, and that the Chancellor of the Exchequer, George Osborne, has just urged Britain to move from "retribution to recovery" over the banks, reform looks distant.

But the doubters are wrong. Yes, we still need a vision of how to confront the corporation and its offshore satellites. Few people in Britain can see the corporation, let alone understand its importance. However, widespread public education, a precursor to reform, can now begin. One of the biggest, most silent players behind so much offshore activity has been identified: a Teflon-like, medieval institution, wrapped around the neck of Britain and dedicated to keeping finance strong and free.

Already I see efforts around the world to constrain the offshore system that feeds the City. UK Uncut, the spontaneous protest movement opposing offshore tax avoidance by multinationals, has had an impact and now pledges to move against the banks. A big "One London" campaign to merge a divided capital into a single democratic entity may seem far off, but groups such as London Citizens are now thinking about the fairer division of London. The Tax Justice Network, and others, are helping build an intellectual edifice for understanding tax havens. Some of their goals - such as country-by-country reporting by multinationals - are already being partly met. The unions, too, and big NGOs, especially those working in international development, are engaging with the matter. An anti-haven mobilisation is under way in France; something similar may be starting in the US. The IMF, the Organisation for Economic Co-operation and Development, the EU and other agencies are now at least debating issues they ignored before. Around the world, legislators, regulators and ordinary people are starting to see the toxicity of Britain's role in protecting offshore business that drains billions out of developing countries each year.

The City of London Corporation - this heart cut out from the body of our vibrant, multicultural metropolis - is no longer so invisible. Now we must figure out what to do about it.

Nicholas Shaxson's book "Treasure Islands" is published by Bodley Head (£14.99)