Kevin Lamarque / Reuters

Even though the Democratic nominee has not yet been chosen, many Americans already know exactly which party they’ll be voting for next November. In fact, a growing number of people instinctively lunge toward one side of the ballot or the other any time an election comes around. Among the factors that shape such deep-seated political preferences, a prominent one is believed to be fundamental moral beliefs—how someone thinks a good society should function or a decent person should behave.

In recent years, researchers have devised a way to test these sorts of “moral foundations” with a quiz. The questionnaire presents a series of declarations such as “It bothers me when people think that nothing is sacred in this world”; “I think that men and women each have different roles to play in society”; “I would say close friends should always take each other’s side first, and ask questions later.” You rank how much each statement describes your actual beliefs, and the test then tells you where you stand on several moral areas, or “foundations.”

According to the researchers who invented the quiz, the issues that most concern political liberals tend to fall under the category of “individualizing” moral foundations, which have more to do with personal standards: care versus harm and fairness versus cheating. Political conservatives, meanwhile, tend to be more concerned about group-focused “binding” foundations: loyalty versus betrayal, authority versus subversion, and disgust versus purity. If loyalty is extremely important to you, the research suggests, you might care deeply about supporting the troops, and therefore you might be more likely to be politically conservative.

Recently, however, a separate team of three scientists posed a question that could upend this connection between moral foundations and politics: What if it’s the other way around? What if you cared so much about loyalty and the troops because you first identified as conservative?

In a series of analyses published recently in the American Journal of Political Science, the three researchers found that people’s moral codes don’t cause or predict their political ideology; instead, people’s ideology appears to predict their answers on the moral-foundations questionnaire. As Peter Hatemi, one of the study’s authors and a political-science professor at Pennsylvania State University, puts it: “We will switch our moral compass depending on how it fits with what we believe politically.”

Hatemi and his co-authors based their analysis on existing data from more than a thousand participants in the American National Election Studies panel from 2008, as well as from a sample of hundreds of Australians originally polled between 2007 and 2011—in both cases, participants took some version of the moral-foundations questionnaire. The trio also administered the moral-foundations questionnaire and a survey about political attitudes to hundreds more Americans from Amazon’s Mechanical Turk platform.

After gathering all this data, the researchers performed statistical analyses to see if people’s moral-foundations answers would help predict, or cause, their political ideology. The answer in both cases was no: Knowing someone’s scores on the questionnaire didn’t help meaningfully predict whether they would have liberal or conservative values several months or years later. However, the reverse held up. People’s political ideology could point toward their moral-foundations answers.

Needless to say, moral and political convictions are complicated. How any one person develops his or her beliefs is always a strange alchemy of upbringing, culture, and innate predispositions. And political parties often clearly appeal to moral values to defend their positions on a huge variety of charged topics, such as abortion, immigration, and gun control. But the new study suggests these values might at least be slipperier than political parties would like to admit.

Hatemi and his team point out two somewhat recent examples of Americans’ party loyalties potentially superseding the moral views they hold. American evangelicals often say they admire morally pure actions and family values, yet in 2016 white evangelicals voted overwhelmingly for Donald Trump, a man who has reportedly had extramarital affairs and bragged about grabbing women by their genitals. Some Democrats who align themselves with the #MeToo movement support Bill Clinton, who has been accused of inappropriate sexual conduct.

Both parties also sometimes rely on similar moral arguments to make opposite cases. The value of life, for instance, has been used by both Democrats and Republicans to support (or oppose) the Affordable Care Act or the death penalty. “People tend to forgive things that are done by politicians on their own sides that they would claim is morally over the line on the other side,” says Kevin Smith, a political scientist at the University of Nebraska-Lincoln and another author of the study.

As with virtually all studies, Smith notes, more research is needed to see if the findings hold up. If they do, they could suggest something a little terrifying for society: that people often make their judgments of right and wrong fit with whatever party they already support. “This has implications that I’m not super happy about,” Smith says. Politicians fight to convince voters that their vision for American is the correct—and often more moral—one, but what if voters don’t actually care? Perhaps people just pick their team and force the rest into place.

Jonathan Haidt, the New York University social psychologist who pioneered the moral-foundations questionnaire, cautioned against taking the new study as the final word on the matter. The Australian data the authors relied on didn’t measure moral foundations in a valid way, he told me. In the other data sets, Haidt said, outside variables—like the election of Donald Trump—might have affected people’s politics, but not their moral-foundations scores. (Hatemi maintains that the Australian data used measures that were recommended at the time, and that he and his authors tested the questionnaire to ensure it would perform the same as the others.)

Despite these caveats, Haidt agrees that there’s a lot of motivated reasoning that goes on in politics. If you “know” you’re a Democrat, you might find ways to make your values seem Democratic. The same goes for Republicans. And when it comes time to decide who to vote for, “tribal loyalty will trump everything else,” even morals, Haidt says. (No presidential pun intended.)

How could foundational moral foundations be so easily discarded when it comes to getting one of “our own” in the White House? Politics, it seems, tends to bring out our tribal, winner-take-all nature. “In a war, the enemy of my enemy is my friend,” Haidt says. “People are very flexible in forming coalitions, even with people who are politically repugnant to them.”

If not moral foundations, the question remains what pushes people toward one party or the other in the first place. Research points to many factors behind this. A major 2013 study of twins in Minnesota found that genes explain part of why Americans are liberal or conservative. While there of course weren’t MAGA-hat-sporting cavemen in our ancestral past, genes do shape things like our brains, our nervous systems, and our endocrine systems. That affects what we pay attention to and remember, which, in turn, can influence our politics.

Take immigration policies: “If you have a reflexive response to people who are not like you, your fight-or-flight system is activated,” explains Smith, who was also an author on the gene study. “You are probably reflexively going to be not supportive of policies that bring those people ... in closer proximity to you.”

Childhood environments and social circles, among many other factors, have also been found to help determine whom people support politically. After you leave your childhood home, “the part of you that’s you breaks out,” says Hatemi. You don’t necessarily go to your parents’ same church or have dinner with their friends anymore, so you might start to form opinions that deviate from theirs, too.

And even if morals do influence our political views, sometimes they only take us so far. “We’re also rational,” Hatemi says. “There’s a point where you might be like, ‘I’m sick of paying 40 percent of my paycheck in taxes.’”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.