Now what?

This is a little complicated. No country has ever voted to leave the European Union before, and it's not clear how things will proceed.

What we know is that British Prime Minister David Cameron will be expected to trigger Article 50 of the Lisbon Treaty, which is the mechanism for a country to leave the European Union. We don't know exactly when he would do so, although he has suggested that he would trigger it immediately, and E.U. leaders would push him to do so quickly.

[BBC: In stunning decision, Britain votes to leave the E.U.]

It is possible that Cameron could opt not to invoke Article 50, perhaps instead repealing the 1972 European Communities Act and withdrawing from the European Union unilaterally. However, such a move probably would anger many E.U. member states with which Britain will soon be seeking a deal and force Britain to immediately legislate to replace E.U. laws with no transition period.

How does Article 50 work?

The article sets out how Britain would negotiate its terms for leaving the European Union. Britain would not negotiate directly with member states. Instead the member states would meet among themselves as the European Council and agree on a framework. Britain would then negotiate on the technical details with the European Commission. The European Parliament also will have a say, giving consent on the deal.

Sounds complicated? It is. And it's unprecedented, so it's not clear exactly what it looks like or how long it would take. The article clearly states that a country will have two years to reach an agreement on the exit, during which time the country would still be governed by E.U. treaties and laws, although it will not be allowed in the decision-making process. However, if all E.U. member states agree, that deadline could be extended.

It's also worth noting that Article 50 does not have a provision that allows a country to back out of the process. And if Britain ever decides it wants to be in the European Union again, it will have to go through the same process as any other applicant country.

Then what?

Britain will have to strike new trade deals with Europe and amend its laws that were based on E.U. legislation. It will take a long time to sort all of that out.

For one thing, it's still unclear exactly what sort of relationship Britain will be able to strike with the European Union. As my colleague Griff Witte has reported, there are essentially four models ranging from what Norway or Iceland has – in which Britain would be a member of the European Economic Area and essentially keep access to the European common market – to simply no deal at all, falling back on its membership of the World Trade Organization to set terms of trading.

Many suspect that the European Union may try to "punish" Britain and deter other countries from making their own exit with a lousy deal. However, if the economic fallout is as bad as some have predicted, it's also possible that European leaders may seek to calm markets with a quick and easy deal.

Will Parliament agree?

The Brexit referendum isn't binding in itself; any deal will have to be approved by Britain's Parliament. This means that pro-remain MPs — i.e. the majority of Parliament — may try to block any deal that they think doesn't give the country enough access to the European Union. The pressure could in turn lead to calls for a new general election.

It does seem unlikely that British MPs would flagrantly go against the wishes of the electorate by totally blocking a Brexit, but they could well use their power to influence negotiations.

Will Cameron resign?

Cameron gambled by calling the referendum. If "remain" loses, he will have lost that gamble. Although the prime minister has said he would not resign in the wake of a vote for Brexit, many in Britain will expect him to resign. It's possible that he may not do so right away – he may set a timetable to step down or wait for a leadership challenge. If the economic fallout is particularly bad, he may argue that he needs to stay in office to help steer Britain back on course, a process that could take months.

Boris Johnson, the colorful former mayor of London, who was a loud voice in the Brexit campaign, is likely to be the favorite for new leader of the Conservative Party. However, his time in office may not last long. If a new leader of the Conservatives is selected, there will be pressure for the leader to call a general election.

What would happen to the financial markets?

The fallout was immediate after the referendum results were clear. The British pound plummeted and Asian stock markets swooned. The turmoil then spread to European stocks and Wall Street. Before the vote, investor George Soros had suggested a drop of 15 percent to 20 percent in the pound if the "leave" side came out on top. The euro is also expected to lose some value in the short term at least.

A wide variety of financial institutions have made dire predictions about the long-term economic effects of a Brexit. Of course, these are predictions. What will happen ultimately isn't certain, but short-term pain for Britain and others seems very likely.

What will happen to the European Union?

The vote will definitely shake the grand European vision. It will certainly provide fuel for anti-E.U. politicians all over the continent. Recent polls have shown that countries such as France and Italy want their own votes on E.U. membership, and populists such as the French National Front's Marine Le Pen have found Euroskepticism to be a powerful message to voters.

At the least, it will give the European Union another logistical problem at a time when it has many others already to deal with, including the refugee crisis, the economic issues across the euro zone and the continuing threat of Russian aggression.

More on WorldViews:

13 Brexit facts that will make Americans feel less embarrassed about their own election

What is Brexit? The complete guide to Britain’s E.U. drama for confused non-Europeans.

Quiz: What do you actually know about the E.U.?