Britain voted Thursday to leave the European Union, a decision that surprised many and one whose consequences still aren’t totally clear. We don’t know quite yet what this will mean for the future of Britain’s economy, its policies, and its relations with other European countries.

There have been many twists and turns in British politics that have led to this particular moment. But you don’t necessarily need to have followed those to understand why the British want to leave the European Union, and why the EU matters in the first place.

That’s what this cartoon is all about: how the EU came to be, and how Britain came to decide not to be part of it. And this will help make sense of the biggest, looming question: What happens next?

Why does the European Union exist, anyway?

Europe is a collection of countries that used to fight a lot. For example, in World War II countries within Europe fought against one another, and it greatly hurt the continent.

So after WWII, many countries felt it was important to integrate European countries — starting with the coal and steel industries and then expanding to a broader set of trade issues.

Countries often make rules about things coming into their countries. For example, if you wanted to make a car in France and ship it to Britain, you would have to pay a tariff to Britain to do so.

Or let's say you're French and you wanted to live and work in Britain. You would have to go through a long immigration process to legally do so.

Western Europe has dozens of countries, each with its own trade, immigration, and economic policies. Trying to navigate these rules was very inefficient. The European Union essentially started from a question: What if each country had the same rules? What if all the barriers came down?

And that’s what the EU did.

Almost every Western European country joined the group to merge their economic rules in 1993. They did this by allowing people, goods, services, and capital to move freely between member countries. It's kind of like how states in the US work.

The EU has helped foster long periods of economic prosperity, and it's helped keep the region at peace.

There are challenges to cooperation. When something bad happens, it affects everyone.

The appealing part of the EU was that it made it easier for European countries to share in one another’s prosperity. But, as with any union, cooperation means weathering downturns together — and that hasn’t always been so easy.

Take, for example, the 2008 financial crisis. Many economists agree that the European Central Bank failed to respond effectively, leading to a recession that was much more severe than it needed to be. Unemployment rose, and tax revenue fell. Banks needed bailouts, and debt in a number of EU countries soared.

Seeing the EU in such crisis made some have second thoughts about being yoked to it — and increased worry among wealthy countries (like the UK) that they might have to help bail out less wealthy countries down the line.

And some Brits didn't like that many foreigners were moving to Britain after the EU was formed

The new European Union made it much easier for citizens of one country to migrate to another. And Britain’s foreign-born population skyrocketed after it joined.

Experts see two main forces driving this trend:

The EU expanded to include post-communist countries in the mid-2000s, and people in those countries were poorer. Many of their citizens immigrated to wealthier countries — like the United Kingdom. The 2008 market crash hit some European countries especially hard. When people from those countries couldn’t find a job at home, their citizens went to find jobs in other countries — like the United Kingdom.

As my colleague Zack Beauchamp writes, "The British labor market was relatively easy to break into, and lots of people across Europe speak English, so it was a natural target for these Southern Europeans."

Tensions over immigration have risen significantly in Britain in recent years

Twenty years ago, barely anyone thought immigration or race relations was one of the country’s most important issues.

Times have changed.

In a survey conducted last year, 45 percent of Brits identified "immigration/race relations" as a top issue facing the country.

Seventy-seven percent of Brits today believe that immigration levels into the country should be reduced.

Last year, British Prime Minister David Cameron announced a referendum on whether Britain should remain in the European Union.

That’s Brexit, the vote that happened yesterday.

And by a slim margin, the British voted to leave the European Union.

This is causing a lot of chaos in Britain; nobody fully knows what will happen next.

Cameron announced his resignation because he was against leaving the EU, and he believes the country should have a leader who wants to take Britain in the direction voters have chosen. The vote doesn’t necessarily bind Britain to leaving the EU, but it likely will, because defying the will of the people would be politically bad.

Untangling from the EU would be a long, painful process

The UK and the EU have two years to figure out the terms of the exit — what rules would still apply to Britain and what privileges Britain would still get.

If there isn't some kind of deal that softens the blow — that lets Britain continue to take advantage of at least some of the European Union cooperations the country previously enjoyed — it'll be ugly.

Economist Jacob Funk Kirkegaard told my colleague Timothy B. Lee that right now UK carmakers can pretty safely assume they can sell their cars in any EU country, because everyone has the same standards. But if there is no agreement, selling that car across the EU could become a lot more complicated.

And this wouldn’t be just about cars — pharmaceutical products, technology, food, or anything else Britain produces could lose its easy entry into other European countries.

It will be tougher for people to move across borders

About 1.2 million Brits currently live in other EU countries. Right now they are able work in these other countries without much hassle. That would change.

There is a possible scenario in which Britain gets to keep its economic agreements in place

One idea is for the British to make a deal with the EU that lets them keep their economic privileges, kind of like Norway. But as my colleagues point out, the EU might not be in a forgiving mood, given that Britain just voted to leave. And this agreement still wouldn't help the British get out from EU regulation.

What are the greater implications?

The EU made trade with Europe much easier for the US, and it also made it easier to ask Europe for geopolitical help. Instead of talking to dozens of different countries, American officials could go to the EU and negotiate with a large chunk of the continent.

Now Britain may not be part of that discussion.

Britain’s departure could have ripple effects throughout Europe, too.

"Poor economic performance and inconsistent handling of the migration crisis have driven majorities in many countries — including France and Spain — to say they’d like a UK-style chance to vote on quitting the EU," my colleague Matt Yglesias wrote earlier today.

Britain’s vote is a big deal. But it could be the start of something bigger, too. This might be the first of many political expressions of discontent among EU countries, potentially causing the disintegration of Europe.

Britain is leaving the EU. Here's what that means.