Although there are legitimate ways of using tax havens, most of what has been going on is about hiding the true owners of money, the origin of the money and avoiding paying tax on the money.
If you are a wealthy business owner in Germany who has decided to evade tax, an international drugs dealer or the head of a brutal regime, the methods are all pretty similar.
Mossack Fonseca says it has always complied with international protocols to ensure the companies it incorporates are not used for tax evasion, money-laundering, terrorist finance or other illicit purposes.
A shell company has the outward appearance of being a legitimate business. But it is just an empty shell. It does nothing but manage the money in it, while hiding who owns the money. Its management is made up of lawyers, accountants or even the office cleaner, who do little more than sign documents and allow their names to appear on the letterhead.
When the authorities try to find out who really owns or controls the money in the company, they are told the management does, but it is all just a front.
Someone else is just paying them so they can hide their money from the authorities or in some cases their ex-wives. Shell companies can also be called "letterbox" companies, as they consist of little more than an address to post documents to.
Offshore Financial Centre
If you have a shell company, you don't want it based in London or Paris where the authorities can normally find out who owns it, if they really want to. You need an Offshore Financial Centre, or what is often called a tax haven.
These are normally based in small island countries (hence the name), with a great deal of banking secrecy and very low or non-existent taxes on financial transactions. There are many such countries or authorities around the world, from the British Virgin Islands, to Macao, the Bahamas and Panama.
Even in such places most of the financial services are perfectly legal: it is just the secrecy which also makes them very attractive to tax evaders and crooks the world over, especially if the regulators are weak or turning a blind eye.
Bearer shares and bonds
For that extra layer of anonymity and so that you can move large amounts of money around easily, bearer shares and bonds are an obvious answer. Every British £5 note has the words "I promise to pay the bearer on demand the sum of five pounds".
That means if it is in your pocket it is yours: the person "bearing" or carrying the cash owns it, can spend it or do what they like with it. Bearer shares and bonds work in the same way, the person who has it in their pocket, briefcase or safety deposit box owns it.
But they aren't worth £5. Bearer bonds normally come in nice round figures like £10,000. Very handy if you want to move vast amounts of money around and great if you want to deny ownership.
If the bond is kept at a lawyer's office in Panama, who is to know whether it is yours, or even that it exists? This helps to explain why the US government stopped selling bearer bonds in 1982. They were just too easy for crooks to use.
Money laundering involves cleaning "dirty" money so that you can use it without arousing suspicion. If you are a drug dealer, fraudster or, let's say, a corrupt politician you will have a lot of cash and no way of spending it or hiding it for a rainy day, without giving the game away.
The money needs cleaning, so you can ship it to a dodgy firm in an Offshore Financial Centre and they might help you convert it into bearer bonds, owned by a shell company that no one knows about.
You could also use it to buy a bolt-hole in London or the South of France in case of a coup, maybe pay the kids' school fees or fund a great aunt's shopping trips to Paris.
Sanctions and sanctions busting
One of the ways of punishing and trying to limit the power of notorious regimes around the world is sanctions. These can involve limits on the importation of military equipment or ammunition, bans on the exports of oil and other goods, and personal sanctions; closing the bank accounts of dictators and their friends, families and supporters. The British government currently imposes thousands of sanctions against countries, their businesses, banks and many named individuals.
But the more onerous the sanctions on a regime the more money is to be made by breaking or busting them. Providing secret bank accounts for torturers and mass murderers, supplying weapons to one or even both sides in a civil war or funding the nuclear ambitions of isolated regimes.
The profits are huge and, of course, lots of secretive bank accounts and shell companies in parts of the world where officials turn a blind eye, is key to making sanction busting profitable and safe. You can see the list of UK sanctions here.
The European Savings Directive
To try to stop people hiding money from the tax authorities the European Union introduced the European Savings Directive (ESD). Basically, banks in EU countries collect the tax due on bank accounts held by citizens of other EU countries. So you can't be an Irish person with a Dutch bank account and hope the Irish tax authorities won't find out about it or collect the tax owed.
The ESD made it much more difficult to hide your money in Europe. It is interesting because when the ESD was being discussed and introduced there was a sudden increase in people who wanted to open bank accounts outside Europe, hence the surge of interest in places like Panama and the British Virgin Islands.
Panama Papers - tax havens of the rich and powerful exposed
* Eleven million documents held by the Panama-based law firm Mossack Fonseca have been passed to German newspaper Sueddeutsche Zeitung, which then shared them with the International Consortium of Investigative Journalists. BBC Panorama is among 107 media organisations - including UK newspaper the Guardian - in 76 countries which have been analysing the documents. The BBC doesn't know the identity of the source
* They show how the company has helped clients launder money, dodge sanctions and evade tax
* Mossack Fonseca says it has operated beyond reproach for 40 years and never been accused or charged with criminal wrong-doing
* Tricks of the trade: How assets are hidden and taxes evaded
* Panama Papers: Full coverage; follow reaction on Twitter using #PanamaPapers; in the BBC News app, follow the tag "Panama Papers"
* Watch Panorama on the BBC iPlayer (UK viewers only)