In the past few days, hundreds (if not thousands) of media reports have linked the Panamanian wealth management firm Mossack Fonseca to a series of financial crimes. The massive “Panama Papers” leak documents the firm’s involvement in facilitating activities that may constitute fraud, money laundering, and theft, including by officials at the highest levels of governments worldwide. But the real scandal is that most of what Mossack Fonseca and the rest of the wealth-management industry do is perfectly legal.

Anyone reading this article can evade taxes, or even dabble in offshore finance, without expert intervention. With just an Internet connection and a few thousand dollars, anybody can create shell corporations and other offshore vehicles in a matter of minutes. It’s child’s play to dodge taxes, debts, child support, and so on by putting assets in one of those structures—though there is  a risk of getting caught, audited, and possibly prosecuted.

But that’s not what many of the world’s richest people are doing: They can afford the privilege of defeating the spirit of the laws without violating them formally. What Mossack Fonseca and its counterparts all over the world really provide is the expertise that allows their clients to stay just on the right side of the law—or far enough into the legal grey zones that the clients have a real chance to prevail if they end up in court. That’s why many of the people who have seemingly been exposed by this leak will likely never face charges of any kind. To the extent that Mossack Fonseca’s work facilitated crime, that was a bug rather than a feature.

Understanding this may help resolve the cognitive dissonance that arises from reading about the Panama Papers against the insistence by Mossack Fonseca that their hands are clean. When the firm writes that “we have a strong compliance record” and “we are responsible members of the global financial and business community,” they are not lying through their teeth, as some might suspect. Keeping clients out of legal trouble is a core element of their business model: that is how they earn their money. If they, or firms like them, were to lose their reputations for keeping clients on the right side of the law, the clients would take their business elsewhere.

Some of the activity uncovered in the Panama Papers will turn out to be illegal. But if past is prologue, then the majority of what we learn from the leak will merely be embarrassing for those exposed—showing them to be opportunistic and perhaps unethical, but not criminal. And that is why many of the people named in the documents are unlikely to see the inside of a courtroom concerning the services that Mossack Fonseca provided to them: not because they have the power now to quash prosecutions (with some notable exceptions!), but because some time ago they had the power to hire expert advisers who carefully designed their tax-avoidance (or law-avoidance) strategies.

This kind of expertise is expensive, and can run into hundreds of thousands of dollars per year, depending on which laws one wants to avoid. But paying for secrecy is typically worth it: If it weren’t for leaks like the Panama Papers, most people would have no idea that so much law avoidance is possible, let alone legally permitted. Many governments know about it, and as the Panama Papers reveal, many public officials take advantage of the benefits these firms provide.

That is one reason so many of their names appear in the leak: 140 politicians and officials from more than 50 countries. While some of those countries are known to have problems with fraud and crime by individuals in government, others are not. Iceland, France, Chile, and Botswana—all of which have officials listed as clients of Mossack Fonseca—are ranked highly on anti-corruption indexes such as the one from Transparency International. Use of offshore services by officials from those countries is unlikely to be connected to illegal activity, although it may well become a political liability for them.

That is how things shaped up for Icelandic Prime Minister Sigmundur Gunnlaugsson, who resigned following revelations that he was once part-owner of an offshore company incorporated with the help of Mossack Fonseca. Although the firm has been wholly owned by his wife since 2009, it stands to reap millions from the deal Gunnlaugsson negotiated for claimants on Iceland’s bankrupt financial institutions. Although reports show no evidence to suggest tax avoidance, evasion, or any dishonest financial gain on the part of Gunnlaugsson,” his mere association with Mossack Fonseca and an offshore firm was enough to cost him his job, and possibly his career.

Public officials who want to put a stop to offshore financial activities face a losing battle due to entrenched conflicts of interest. Because these activities are often formally legal and extremely lucrative—particularly for nominally onshore countries—there is little will to shut them down, and thereby turn off the spigots of economic growth. This means that reform-minded officials are unlikely to gain the cooperation of their colleagues and government agencies in fighting against the secrecy and shell games through which the tax avoidance business operates. Anyone pushing for change rapidly comes to the realization that, at both the personal and institutional levels, many governments are deeply enmeshed in the kind of financial activities revealed by the Panama Papers. Often, the very same people who rail against tax avoidance and offshore finance are themselves beneficiaries of those strategies.

Take the U.K. as an example of this problem. Prime Minister David Cameron has been an outspoken opponent of “dodgy tax-avoiding schemes” by well-to-do U.K. citizens, describing such schemes as "morally wrong." At the 2013 meeting of the G8, Cameron spearheaded an international initiative to “fight the scourge of tax evasion and aggressive tax avoidance.” But Cameron has also benefitted personally from such schemes, including an offshore corporation created by his late father Ian: Blairmore Holdings Inc., which is a client of Mossack Fonseca and incorporated in Panama, is still in operation and owns $31 million in assets. Profits from that corporation have never been taxed in the UK, and were reported to have been a part of the inheritance the Prime Minister received when his father died.

Even if Cameron lacked this personal conflict of interest, he would still face the problem of his country’s institutional entrenchment in tax avoidance and offshore finance. For example, the U.K. economy is closely tied to the offshore world through its property markets. Buying London real estate is among the favored method for oligarchs, particularly from Asia and the former Soviet states, to avoid taxes and launder the proceeds of corruption. Their investments, usually made through offshore corporations and trusts, have contributed significantly to the U.K. economy: London housing stock is now estimated to be worth more than the entire GDP of Brazil. Anything that impinged on those transactions, for example by making it harder to buy real estate through shell corporations, could deflate property values and threaten the British economy overall (although it might make the city affordable again for non-oligarchs).

Of equal or greater importance is the role of the City of London in the tax-haven business. The City, a square-mile financial services hub in the heart of the U.K.’s capital, serves as “the centre of the most important part of the global offshore system.” Last year, that square mile alone contributed $64 billion to the nation’s GDP, and its economic output is growing faster than that of the U.K. as a whole. Any move that impinges on offshore financial activity, including cracking down on tax avoidance, would strike directly at that important source of economic growth for the country. Thus, a former U.K. government official who worked under Cameron wrote that the Prime Minister cannot and will not make any real effort toward ending tax-haven activity, because such a move “would have severely hurt the City of London” and that “it was and is a top U.K. government priority to head that off.”

The U.K. is far from unique in holding this conflicted position relative to the offshore world, and nations like Panama know it. For example, the U.S. has been very aggressive about cracking down on overseas tax avoidance in recent years. But it has also become a popular tax and secrecy haven in its own right, earning it the nickname “the new Switzerland.” Thus, calls by European and North American countries for crackdowns on “harmful tax competition” are increasingly met with derision and anger offshore. Panama and other offshore financial centers know that individual firms like Mossack Fonseca are just part of a web of “legal corruption” that reaches virtually every country in the world. Destroying that web would bring down many firms, and probably a few governments as well. So far, no one has been willing to do more than pull at a few strands at a time.