In Employment Division v. Smith, a case decided by the Supreme Court in 1990, Justice Antonin Scalia led the majority in ruling that the state of Oregon was allowed to deny unemployment benefits to two men fired from their jobs after ingesting peyote, an illegal drug, in a Native American religious ceremony.

At the time, the ruling substantially narrowed constitutional protections for religious freedom by stating that so long as a law like the peyote ban was officially applied neutrally between religious and nonreligious people, it did not violate the First Amendment — even if in practice it led to specific burdens on minority religious faiths.

More than 30 years later, Smith is a fascinating case study for thinking about how political divisions really work — especially our pandemic-era arguments about safety vs. liberty, the rights of the individual vs. the public-health obligations of the state. Not just the ruling but its reception and changing partisan valence say a lot about how what seems like stern ideological principle is really flexible — and how people come around to new positions on policy as soon as the in-groups and out-groups, the people benefiting and the people burdened, seem to be reversed.

Start with a simple-seeming question: Was the Smith ruling a conservative one? It would appear so just from looking at the way the justices' positions broke down, with Scalia the conservative icon writing the majority opinion and three liberal justices dissenting.

But the backlash against the decision was bipartisan, with liberals and religious conservatives alike decrying the new restrictions on religious liberty. The result of that backlash was the Religious Freedom Restoration Act of 1993, offering religious believers more legal protections, which passed the House of Representatives unanimously and the Senate overwhelmingly before being signed into law by Bill Clinton.

So maybe the logic of Smith was so right-wing that even Republicans balked at its application? Except that if you leap forward a few decades to our own era, that ideological analysis falls apart. Today, laws modeled on that act are opposed by many liberals, on the grounds that they offer too much protection for religious weirdos — meaning now not peyote-ingesting Oregonians but the Christian baker who doesn't want to make a cake for a same-sex wedding. Meanwhile, among conservatives, Scalia's Smith opinion is widely regarded as one of his worst mistakes, and the Republican-appointed majority currently on the Supreme Court seems poised to erode its applications.

Because the legal minds involved in these debates are clever, they can come up with ways to harmonize the shifts in terms of ideological principle. But looking at the whole story you could be forgiven for thinking that the best explanation for Smith's changing valence is just a change of in-groups and out-groups in American life.

The conservative majority that issued the 1990 decision, in other words, may have assumed at some level — a subconscious one, even — that they were establishing a precedent that would mostly be applied against New Agers and hippies, not their own mainstream religious traditions. The bipartisan reaction reflected the fact that the early 1990s were a moment when cultural conservatives and cultural liberals could equally imagine themselves as a potentially disfavored group. And the shift to today's world, in which liberals put "religious liberty" in scare quotes and conservatives lament the Smith precedent, reflects religious conservatism's increasing status as its own kind of weird, feared out-group, petitioning for exceptions from the legal and cultural rules laid down in liberal states.

Apply that kind of analysis to the COVID era and you can see the same thing happening on fast-forward. Early in the pandemic a political observer might have assumed that facing a mortal threat — one that emerged in China, no less — conservatives would embrace restrictions and quarantines the way they embraced the Patriot Act and other post-9/11 expansions of federal power, while liberals and the left would accuse the right of giving up too much liberty for the sake of safety.

Something like this divide existed very early on, with conservatives like Sen. Tom Cotton of Arkansas expressing alarm about the outbreak while liberals decried the potential racism of a "Wuhan virus" panic. But by late spring of 2020, the entire dynamic was reversed: Liberals supported tough government interventions to fight the virus, the right was full of fierce libertarians, and so it has mostly remained.

You can blame Donald Trump's early insouciance for establishing this pattern, or the way that COVID hit blue metropoles hardest early while taking much longer to take root in rural regions. But it's also useful to do in-group/out-group analysis, which suggests that conservatives were more willing to support limitations on liberty that fell on foreigners and international travelers — to them, out-groups — but balked at restrictions that seemed to fall most heavily on their own in-groups, from the owners of shuttered businesses to the pastors of closed churches to the parents of small children deprived of school.

For many liberals, it was the opposite. Early on, the idea of a travel ban or quarantine rule looked authoritarian and bigoted because it seemed likely to punish their own constituencies, especially immigrant communities in big cities. But the restrictions that were imposed from March 2020 onward were developed within one of liberalism's inmost in-groups — the expert class, the public-health bureaucracy — and geared in different ways to the needs of other liberal constituencies: The professional class could adapt to virtual work, the teachers unions could mostly keep their paychecks without risking their health, and the youthful anti-racism activists of spring and summer 2020 were conveniently deemed to be exempt from the rules that forbade other kinds of gatherings.

This same pattern shows up in the debate over vaccine mandates. The mainstream right clearly found it easier to be uncomplicatedly pro-vaccine when anti-vax sentiment was coded as something for crunchy "Left Coast" parents, as opposed to conservatives skeptical of the public-health bureaucracy and sharing Facebook posts on ivermectin.

On the other hand, the American Civil Liberties Union, or at least its Twitter account, has decided that vaccine mandates "actually further civil liberties" rather than traducing them. This seems somewhat hard to square with many of its past fears about government overreach in a pandemic — until you consider that those fears probably assumed a right-wing government acting punitively toward immigrants and racial minorities, whereas now the imagined target of the Biden administration's mandate is white, rural and Republican.

The point of noting this dynamic is not to simply condemn everyone involved for hypocrisy. First, a lot of small-d democratic politics is inevitably just the negotiation between different groups based on their immediate interests rather than high principle, and it shouldn't alarm us unduly that principle often bends to accommodate the defense of one's own side.

Second, there can be a terrible and icy consistency among people who don't change their views at all when the in-groups and out-groups seem to shift. Some of the most consistent people in politics right now, for instance, are former Bush Republicans and 9/11-era hawks talking about Trump supporters who think the election was stolen the way they used to talk about foreign terrorists and the domestic left. In one sense their principle is admirable, but in another sense they seem to have learned nothing from the excesses of their own past alarmism, their War on Terror mistakes.

Third, changing your views because your own group's stake in a debate changes can sometimes be a path to stronger principle, greater charity or both. The years just after the Smith case, for instance, saw the founding of the Becket Fund for Religious Liberty, which today defends the religious freedom of a broad array of plaintiffs — not just conservative Christian groups but also the Muslim prison inmate or the Apache defenders of their sacred land, seeking genuine consistency across otherwise very different cases.

What's most worrisome about the way the pandemic has intersected with polarization isn't the inevitable tendency of people to change their principles depending on group interest. It's the weakening of institutions that are supposed to do what Becket does and balance that in-group bias by standing a little more permanently on principle. Even if you favor President Joe Biden's vaccine policies, for instance, you would ideally want an organization devoted explicitly to civil liberties to have a slightly more cautious take on a vaccine mandate than a typical liberal partisan, or else the ACLU doesn't really have a reason to exist.

At the same time, there have been individuals who have played a staunchly independent pandemic-era role: liberal journalists and academics skeptical of long-term school closures or overzealous masking rules, libertarian thinkers who have rejected the tendency of their co-partisans to minimize the virus' seriousness.

That's what a healthy democracy should generate, out of a crisis like this — not just new ideological alignments based on in-group interest but new groups that can help mediate between our warring factions on the basis of a consistent commitment to the truth.