Following the resounding victory of the Conservative Party last year, the political drama of Brexit is seemingly in its final stages. On January 31, the United Kingdom is set to begin a transition period that will conclude at the end of 2020 with the official withdrawal of the nation from the European Union. With this departure, however, a new political drama may emerge.

While the U.K. as a whole voted in favor of Brexit back in the summer of 2016, most residents of Scotland—specifically, 62 percent—cast their ballots in hopes of remaining in the European Union, which offers Scotland the trade benefits of a single market and has contributed significantly to the country’s infrastructure and industry.

In a statement released at the time of the vote, First Minister of Scotland Nicola Sturgeon said, “As things stand, Scotland faces the prospect of being taken out of the E.U. against our will. […] I regard that as democratically unacceptable.”

The alternative, a Scottish departure from the United Kingdom, would be a shock to a union that has existed for more than 300 years. And though Scottish voters rejected independence with a resounding no as recently as 2014, that was before Brexit was on the table.

In recent months, Sturgeon and other members of the pro-independence Scottish National Party have floated the possibility of a second referendum. Given the “material change of circumstance” since the 2014 vote, the argument goes, Scots are likely to arrive at a new consensus.

Polling conducted by What Scotland Thinks reflects a rise in support for independence but suggests the “Yes” side is still just shy of a majority. Still, says John Curtice, a political scientist at Strathclyde University who runs the polling site, “The majority against is not that big, and the longer the timeframe, somewhat greater the level of support.”

As Alan Renwick, deputy director of University College London’s Constitution Unit, explains, proponents of independence offer two main arguments. The first centers on national identity and sovereignty, suggesting Scotland’s “right for self-determination has been violated,” while the second focuses on access to trade. Interestingly, Renwick notes, the latter of these has actually been weakened by Brexit, as Scotland would be “leaving [the U.K.], a market that is much more important […] in terms of Scottish exports,” for an E.U. market with lower relative export value.

“There are those head and heart sides of the argument,” says Renwick, “and it’s not at all clear which of those might dominate in any future independence referendum.”

It remains to be seen whether Sturgeon will actually be able to follow through on her proposed independence vote—particularly in lieu of the news that Prime Minister Boris Johnson has formally rejected her request for a second referendum—and, if so, whether Scots are ultimately in favor of independence. In the meantime, Smithsonian magazine has you covered with a primer on the tangled history of Scottish sovereignty.

The early years

The inhabitants of what is now Scotland fiercely protected the region’s independence long before the kingdom’s official establishment in 843 A.D. When the Roman Empire’s armies, emboldened by their successful conquest of southern Britain, arrived in Scotland during the first century A.D., they were met by tribes who quickly “turned to armed resistance on a large scale,” according to Roman historian Tacitus.

Outmatched by the Romans’ “highly disciplined […] war machine,” writes Ben Johnson for Historic U.K., the locals, called Caledonians by the Romans, resorted to guerrilla tactics like carrying out night-time raids on unsuspecting Roman forts. Although the Scottish tribes suffered a devastating defeat at the Battle of Mons Graupius in 83 A.D., the skirmish marked the Romans’ furthest advance into Scotland, and over the next several centuries, Rome failed to secure additional territory in the region. In northern Scotland, meanwhile, a tribe known as the Picts gained traction and started carrying out border raids at the far reaches of Hadrian’s Wall. By 212 A.D., the Romans had all but abandoned Scotland, and in 410, they withdrew from Britain entirely.

The next wave of outsiders to stake a claim on Scotland were the Vikings, who launched their first attacks on the British Isles during the late eighth century. These Scandinavians didn’t venture to new lands solely in search of plunder. Many settled down, making homes for themselves in places like Ireland and Scotland and building ties with existing communities. Still, the Vikings’ intentions weren’t entirely noble, and in the mid-ninth century, a tribal leader named Kenneth MacAlpin united the famously fragmented Scottish clans in the fight against the foreign invaders. In doing so, he became arguably the first ruler of the Kingdom of Scotland, founding a dynasty that would endure for centuries.

The Wars of Scottish Independence

During the medieval period, England started treating its northern neighbor much like a feudal territory. In response, Scottish patriots banded together under William Wallace, the freedom fighter forever (erroneously) cemented in popular imagination as a blue paint-covered kilt-wearer. Wallace and his men won a decisive victory at the Battle of Stirling Bridge in September 1297 but lost momentum and, in July 1298, suffered a devastating defeat at the Battle of Falkirk.

After Falkirk, Wallace went on the run. He evaded the English for years but was captured and executed in August 1305. As Wallace’s influence faded, Robert the Bruce seized power. Following years of fighting, most famously at the Battle of Bannockburn in 1314, Bruce convinced England to recognize Scotland’s independence, bringing the First War of Scottish Independence to a close in 1328. Though a Second War of Scottish Independence began soon after Bruce’s death, it petered out when England’s focus shifted to the Hundred Years’ War against France.

In Scottish lore, Wallace and Bruce are the figures around whom “pretty much everybody inside the [modern] nationalist movement is able to unite behind,” says Curtice. “Bannockburn is probably […] the most iconic piece of anti-English history.”

The Stuart dynasty and the English Civil War

When Elizabeth I died childless in 1603, an opportunity arose for unification between the neighboring nations. The deceased monarch’s distant cousin James VI of Scotland, son of Mary, Queen of Scots, took the English and Irish thrones as James I, becoming the first monarch to unite the three nations under one crown. His accession, in the words of University of Glasgow historian Karin Bowie, was a “dynastic accident” with longstanding consequences.

Though James hoped to unite England, Ireland and Scotland in one kingdom, his vision proved unpopular, and over the coming century, civil war and rebellion ran rampant in all three kingdoms. James’ son Charles I showed even less foresight than his father, and his tyrannical tendencies eventually cost him both the crown and his head. In the ensuing English Civil War , Scots fervently backed the forces of Charles II, who upon retaking the throne after the 1660 death of Lord Protector Oliver Cromwell, was hailed as king of England, Scotland and Ireland.

Charles was succeeded by his brother James II, who in turn lost the throne to Protestant William and Mary during the bloodless Glorious Revolution of 1688. (As the Catholic king of a largely Protestant country, James, whose Latin name inspired his supporters’ classification as Jacobites, alienated his subjects by prosecuting Anglican bishops and suspending the Scottish and English Parliaments after they refused to repeal anti-Catholic legislation.) Mary’s sister Anne inherited the throne following the couple’s untimely deaths, ushering in what would prove to be a decisive new era in Scottish-Anglican relations.

The Acts of Union and the Jacobite revolts

The contentious events of the 1690s and early 1700s—Scotland’s failed attempt to colonize what is now Panama decimated the country’s economy while divisions in the Scottish Parliament left the fate of the succession unclear, among other crises—culminated in the formation of a new kingdom.

On May 1, 1707, England and Scotland officially united, becoming “One Kingdom by the Name of Great Britain.” According to Bowie, two main factors precipitated the arrival of this long-portended union: Scots were dissatisfied with “how they were being governed within the union” of crowns, and the monarchy created by the Glorious Revolution was “precarious,” under constant threat of rebellion by the Jacobite supporters of the deposed James II.

The treaty passed by both nations’ parliaments lent Scotland economic security and access to England’s colonial trade network; meanwhile, a provision that excluded all Catholics—namely, James’ exiled descendants—from the royal succession gave England a safeguard against the Jacobites and Catholic France.

With the passage of the Acts of Union, coinage, taxes and trade were standardized across Great Britain. Scotland retained its legal, religious and educational systems but joined the main British Parliament, albeit with a disproportionately low number of representatives.

The union of these two oft-warring countries proved predictably unpopular. As poet Robert Burns later observed, many Scots believed their representatives had been “bought and sold for English gold.”

Per Bowie, the Scottish Parliament voted to accept the union by a “fairly lukewarm majority” dominated by members of the nobility. Unionists tended to be fairly well-to-do and highly educated, but they met a “huge amount of resistance” from Scottish nationalists who shared a deep-seated distrust of England.

By 1715, discontent over the union’s adverse political and economic effects was widespread enough to spark a Jacobite-led rebellion. According to the U.K. Parliament portal, the Jacobites painted themselves as “defenders of Scottish liberties,” pledging to repeal the union and restore Scotland’s parliament, but remained chiefly concerned with restoring the crown to the descendants of James II.

Though George I was able to quell the 1715 rebellion, the Jacobite cause remained a strong force in the Scottish Highlands, and in 1745, a second revolt centered on Prince Charles Edward Stuart, better known as Bonnie Prince Charlie or the Young Pretender, broke out. Following the revolt’s failure, the British government implemented harsh policies aimed at dismantling the Highlands’ clan system and eliminating the Jacobite cause once and for all.

Modern Scotland

By the late 18th century, the issue of Scottish versus English identity had been largely subsumed by the countries’ shared conflicts with other members of the British Empire, including the American colonies and Ireland. Scotland’s textile industry thrived, sparking industrialization and urbanization, and Scots gained more power within the British government.

Scotland “joined England just at the time, or just before, England takes off with the Industrial Revolution,” says Curtice. Its inhabitants profited “disproportionately” from Britain’s imperialism and industry, and for at least 150 years or so, the country was a “well and truly signed up part of the British Empire.”

But the question of independence, or at the very least devolution of power, remained of interest to Scots. When Prime Minister William Gladstone, a Brit of Scottish descent, proposed the restoration of an Irish parliament “separate from but subordinate to Westminster” in 1886, his conception of “home rule” also took root in Scotland, which had won a measure of administrative devolution with the establishment of the Scottish Office the year prior.

Member of Parliament William Cowan introduced a bill aimed at creating a separate Scottish parliament in 1913. His impassioned opening statement offered a prescient glimpse of contemporary talking points, criticizing English MPs who “imagine themselves experts on Scottish affairs” and calling for Scottish control over legislation “for land, for the liquor trade, for education, for housing, for fisheries, for ecclesiastical affairs, for one-hundred-and-one matters of purely local concerns.”

The advent of World War I suspended discussions of home rule for both Scotland and Ireland, but in 1922, the Irish Free State managed to successfully break away from the U.K. after a bloody guerrilla war. According to Curtice, Britain’s economic dominance and status as an imperial powerhouse began to fade around the same time as the conflict’s denouement, limiting the benefits Scotland reaped as a member of the union.

In 1934, the National Party of Scotland and the Scottish Party joined together to form the Scottish National Party. Plagued by infighting and policy differences, the nationalist SNP nevertheless gained momentum during World War II, with politician Robert McIntyre winning the party’s first seat in Parliament during an April 1945 by-election. Following the war’s conclusion, McIntyre immediately lost his seat, and, in the words of Curtice, “Party politics went back to normal.”

Outside of several largely symbolic victories—including nationalists’ Christmas 1950 theft of the Scottish coronation Stone of Scone, housed in Westminster Abbey since 1296—the SNP’s growth stagnated in the decades that followed. With the discovery of oil off Scotland’s North Sea coast during the 1970s, however, the party’s message started to resonate with more voters, and in 1974, the SNP won 11 seats in Parliament.

Building on this success, nationalist politicians introduced a referendum designed to gauge support for a local Scottish Assembly. Though pro-devolution voters just edged out the competition, only 32.8 percent of the electorate turned out for the referendum, rendering the verdict null and void.

A 1997 devolution referendum proved more successful, with Scotland overwhelmingly voting in favor of a decentralized legislature; the new governing body met in Edinburgh for the first time on May 12, 1999.

For those hoping to preserve the United Kingdom, says Curtice, devolution was “an attempt to stymie the demand for independence.” But for the SNP, devolution was simply a “stepping stone” on the path to a fully autonomous Scotland.

The SNP won the Scottish Parliament’s first majority government in 2011, paving the way for the 2014 independence referendum. Ultimately, 45 percent of Scots voted in favor of leaving the U.K., while 55 percent voted against.

Though many of the issues debated around the time of the 1707 Acts of Union are no longer relevant, Bowie says the events of the 18th century hold valuable insights for the current independence movement.

“The union comes out of a ten-year context,” she explains. “That longer-term context of the union of crowns not working very well applies, but it had gotten particularly bad in the last ten years before 1707, so it’s in response to quite short-term pressures.”

While the formation of the United Kingdom yielded “great fruitfulness” in many areas, including the development of a shared British identity, the historian adds, “There’s nothing immutable or inevitable about it.”

Says Bowie, “This is probably the fundamental moral. If it’s not inevitable, then that means it’s a construct. And for it to last, it has to work. […] Like any relationship that needs to be maintained and sustained, if it starts to break down, it can potentially be recovered, but effort has to be put into that.”