One of the enduring puzzles of contemporary American politics is why white evangelicals, who loudly proclaim their devotion to the teachings of the Bible, continue to support the thrice-married, six-times-bankrupted, multiple-times-unfaithful, chronically lying president, who has, at the very least, violated three of the Ten Commandments (“Thou shalt not commit adultery,” “Thou shalt not steal,” and “Thou shalt not bear false witness”) and arguably several others.

As the Stormy Daniels affair continues to unfold—and as it becomes more and more likely that it will be confirmed that the president did have an extramarital affair with a porn star three months after his third wife gave birth—it becomes increasingly bizarre to watch white evangelicals stand by their man. After all, evangelicals’ religious beliefs seem in direct opposition to their support for the president’s actions. To many, the evangelical embrace of Trump seems a “corruption of a religious tradition by politics,” as Michael Gerson put it in his recent Atlantic cover story.

But behind the apparent disparity, there exists a psychological kinship between Trumpism and evangelical thought—at least, for white evangelicals. (In this article, I am focusing on white evangelicals.) The similarities in their approaches to the world run so deep that I believe that white evangelicals would continue to support Trump even if Roe v. Wade weren’t in the picture.

The justification evangelical leaders most often offer for Trump’s decidedly unbiblical actions—after “it’s fake news” and “but he’s not doing it anymore”—draws on the Bible itself. Throughout history, they say, God has enlisted imperfect people to fulfill his perfect will. Jerry Falwell Jr., president of evangelical college Liberty University, put it this way: “God called King David a man after God’s own heart even though he was an adulterer and a murderer,” adding, “I think evangelicals have found their dream president.”

This argument is a bit suspect. In 2011, a PRRI–Brookings Institute poll asked Americans, “Do you think an elected official who commits an immoral act in their personal life can still behave ethically and fulfill their duties in their public life?” Only 30 percent of white evangelicals agreed. But asked again in 2016, days before Trump was elected president, 72 percent said that they believe that the two can go together. It is hard to escape the conclusion that the biblical argument Falwell and others are offering is pure rationalization for their support for Donald Trump.

But behind the apparent disparity, there exists a psychological kinship between Trumpism and evangelical thought—at least, white evangelicals.

There should be nothing surprising about this: White evangelicals have long supported conservative Republicans. In 1972, Richard Nixon garnered 84 percent of their vote. In 1984, Ronald Reagan took in 80 percent, and in 2004 and 2012, respectively, George W. Bush and Mitt Romney each collected 78 percent. So Trump’s 81 percent was not any real departure from the norm.

Although some claim to have found the roots of evangelical political conservatism in the faith- and Bible-based beliefs that modern evangelicals inherited from Martin Luther, there is nothing intrinsic in evangelical theology that pushes people to the right. The Second Great Awakening of the 1830s and 1840s was linked to social-reform efforts. William Jennings Bryan, Populist Party hero and three-time Democratic Party nominee for President, proudly proclaimed himself “a progressive in politics” though “a fundamentalist in religion.” Today, black evangelicals, adhering to the very same theology as white evangelicals, lean to the left, not the right.

Even for white evangelicals, many of the positions now associated with their conservatism were not always so clear. Both the National Association of Evangelicals and Christianity Today, the flagship evangelical magazine, initially supported the Supreme Court’s 1962 Engel v. Vitale decision to bar school prayer. As recently as the late ’70s, half a decade after Roe v. Wade, the National Association of Evangelicals opined, “We recognize the necessity for therapeutic abortions to safeguard the health or the life of the mother,” and the Southern Baptist Convention reaffirmed its belief that personhood began at birth, not at conception.

“Preachers are not called upon to be politicians, but soul winners,” wrote Baptist minister Jerry Falwell in 1965.

But by the end of the ’70s, things began to change. The percent of the American population adhering to evangelical beliefs grew rapidly. Right-wing fundamentalist preachers took over organizations such as the Southern Baptist Convention. There was a rapid rise of separatist Baptist churches, proclaiming a fundamentalist theology, denouncing the moral ills of society and communism, and often promoting segregationist views. In 1979, Jerry Falwell joined hard-line conservative activists such as Heritage Foundation and American Legislative Exchange Council co-founder Paul Weyrich to form the Moral Majority, a political action group focused on mobilizing Christians against “secular humanism” and moral decay. Evangelical pastors threw themselves into the political arena and worked for 1980s conservative electoral victories. Simultaneously, largely evangelical white voters in the South shifted rapidly from the Democratic Party to the Republican Party, and American politics as a whole moved sharply to the right.

Why did millions of Americans both embrace evangelical religion and adopt the evangelical leaders’ newly hard-line conservative positions? It’s tempting to assume that they were trying to make their political beliefs (e.g., on issues such as abortion and school prayer) consistent with their evangelical theology.

But I don’t think that’s the case. The mass appeal of evangelicalism is not so much the literal content of its theology as what might be called the emotional theology behind the literal theology—the way in which evangelical beliefs resonated with adherents’ psychological needs. The same psychological predispositions that led many people to conservatism led them to adopt evangelical beliefs.

Start with the psychological predispositions that accompany conservative politics: Psychologists have consistently found differences between conservatives and liberals in average personality traits, attitudes, and moral stances. Conservatives are more likely than liberals to accept or even embrace authority that is perceived to be legitimate. They tend to be more moralistic than liberals and to have a stronger need for order and control. They also tend to show higher levels of repression of aggressive and sexual impulses and are more likely to identify with aggressors.

Conservatives also show a greater tendency than liberals toward dichotomous thinking and have a stronger need for certainty and cognitive consistency. (“I don’t do nuance,” George W. Bush famously told Joe Biden.) Compared to liberals, conservatives’ moral sense is less centered on fairness and kindness and more on loyalty, deference to authority, and moral and sexual purity.

Evangelicalism is linked to the very same personality characteristics. Evangelical parents teach their children obedience to authority. Evangelical parents, sociologists John Bartowski, W. Bradford Wilcox, and Christopher G. Ellison found, “tend to value children’s obedience while generally downplaying the importance of youngsters’ autonomy.”

Dichotomous thinking, a trait associated with conservatism, is equally central to evangelical thought: God and man, saved and unsaved, Christianity and secularism, abstinence or the devil, male and female, life begins at conception and not at some nebulous time between then and when consciousness and rationality emerge. There is no room for ambiguity.

And both conservatives and evangelicals are more likely to see human nature as bad. As Baptist minister and former Republican congressman J.C. Watts put it, “The difference between Republicans and Democrats is that Republicans believe people are fundamentally bad, while Democrats see people as fundamentally good.” Or, to translate this into evangelical language, “We are all sinners in the hands of an angry God.”

Modern hard conservatism provides believers with a secular version of evangelical eschatology: Since the early part of the 20th century, evangelical thought has shifted toward “premillennialism,” the belief that, as Gerson put it, “the current age is tending not toward progress, but rather toward decadence and chaos under the influence of Satan.” In parallel, today’s right believes that America is on the brink of destruction; salvation can only occur through a return to the certainties of the past (“Make America Great Again”).

Not coincidentally, many evangelical Christians believe that Trump was chosen by God to usher in a new era, a part of history called the “end times.” The end is near. According to a 2010 survey, fully 58 percent of white evangelical Christians say Jesus Christ will definitely or probably return to Earth within the next 40 years. Only four years earlier, the number expecting His return “in their lifetime” was only 20 percent.

The same psychological predispositions that led many people to conservatism led them to adopt evangelical beliefs.

The feeling shared by many evangelicals that the “traditional” family and older industrial and agricultural communities throughout America are under siege is not entirely unfounded, of course. Loss of jobs due to globalization, automation, flat wages, growing inequality, and declining social mobility have increased pressure on families and have disrupted communities. The years since the late 1960s have also seen a transformation in women’s roles at home and at work, the rise of the gay movement and the demand for gay marriage, and rapidly changing boundaries between acceptable and unacceptable sexual behavior. And the collapse of the old racial order in the South, the economic and social advances made by people of color (including the election of a black president), and rising rates of immigration (legal as well as “illegal”) have destroyed the old white America. While liberals take these developments as a clear sign of progress, many of those who were “left behind” by the changes of recent decades and whose previous sense of power was upended were left with a brooding sense of anxiety and grievance over no longer being central to American society and culture.

The most rational response, and probably the most effective, would have been to address the actual sources of the economic disruptions. But by the early 1980s, when the forces of change were starting to take hold, most white evangelicals were already politically conservative. And their political vehicle, the Republican Party, had no interest in addressing the economic forces that were potentially reversible sources of the anxiety.

Evangelical religion and the beliefs about social issues that go along with it provided an alternative narrative. Like Trumpism, evangelicalism appeals to a sense of grievance and cultural dispossession. Yale sociology of religion professor Nancy Ammerman has shown that fundamentalist evangelical beliefs appeal most strongly to rural people and especially to people who have moved from rural areas to urban areas. Evangelicalism attracts blue-collar workers with lower and middle incomes and less education than a college degree. People who had experienced economic grievance and cultural dispossession, and who had been exposed to a more diverse world than what they grew up in, but who lacked the experience and resources to deal with these challenges, migrated to evangelical churches.

The links between conservatism and evangelicalism are long-standing and strong. But several recent factors have strengthened the links and contributed to the failure of white evangelicals to recognize the conflict between their ostensible theological beliefs and their support for Donald Trump.

First, contemporary America has increasingly been caught up in identity politics (including white identity politics) and political and moral tribalism. Sociologists and political psychologists have found that Americans’ decisions to ally themselves with a political party is less and less based on the degree to which the parties match their own ideological principles and more and more based on their own social identity, including their religious identity. As people come to identify themselves as both evangelical and conservative, it is as if they are saying to themselves, “to be evangelical is to be conservative.”

People also more and more tend to define their own beliefs in opposition to the politics (or political figures) they oppose rather than because of their own positive values. This effect has been found to be more strongly related to Republican partisanship than to Democratic partisanship. As the animus toward the opposing political party has grown over the past two decades, people’s partisan and ideological leanings have become more consistent. Conservatism and white evangelicalism increasingly became fused, and the pressure grew on the evangelicals to believe that their political and religious beliefs were compatible, even if to an outside observer they seemed to be inconsistent.

This tendency to seek cognitive consistency is universal, of course. When some of our beliefs or allegiances are inconsistent with others, we are motivated to find some way to bring them into alignment. Conservatives, whether evangelical or not, are more likely than liberals to do this by simply disbelieving information that is inconsistent with their political opinions.

A second factor contributing to evangelicals’ ability to reconcile their ostensible religious tenets with their political beliefs comes from changes in evangelical political thought itself. White evangelical support for Trump is increasingly driven by Christian nationalism. The more someone believes that the United States is a “Christian nation,” the more likely they were to vote for Trump. “We are going to protect Christianity,” Donald Trump told students at Liberty University. “Now, in these hard times for our country, let us turn again to our Christian heritage to lift up the soul of our nation.”

The belief that the U.S. should be a fundamentally Christian nation is not about moral purity or theological consistency. It is about believing that the government should advocate Christian values, that it is fine for religious symbols to be displayed in public places, that prayer should be allowed in public schools. It is about fantasies that Christianity, the religion at least rhetorically adhered to by 83 percent of Americans, is endangered.

As sociologist Philip Gorski points out, this kind of religious nationalism is unmoored from traditional Christian ideals and morality. It makes religious identity the test of national belonging, strips religious identity of its theological content, and functions as a marker of what could be called Trumpian ethnicity. The true believer can believe both in Trump, with all of his moral failings, and in oneself as a true Christian.

Finally, the pass given by many white evangelicals to Donald Trump for his sexual conduct, and most recently for his initial denial and subsequent acknowledgement of having paid off Stormy Daniels in return for her silence, may be closely tied to the sexual dynamics of evangelical adherents. The superficially obvious conflict between the sexual morality of evangelical theology and the behavior of Donald Trump is diffused by the fact that the former is less absolute than it seems.

Like Trumpism, evangelicalism appeals to a sense of grievance and cultural dispossession.

On the surface, evangelicals proclaim a very rigid and “traditional” sexual morality. For instance, the “Nashville Statement,” a 2017 statement by the Council on Biblical Manhood and Womanhood signed by 148 evangelical leaders, insists on chastity outside of marriage and fidelity within marriage, denounces sexual impurity, and (in no fewer than four of its 14 articles) denounces homosexuality as inconsistent with God’s holy purpose.

Radical evangelicalism itself expresses an exaggerated hypermasculinity. Power is valued, not nurturance or tenderness—corresponding perfectly to Trump’s values. And adherence to religious denominations that demand sexual purity and whose doctrines are, in Atlantic writer Emma Green’s words, “about reaffirming the God-given, differentiated sexuality of men and women,” reassuring. (This was especially so in the South, which has a long history of preoccupation with the dangers of sexuality and of a troubling confusion about sexuality and race.)

American culture’s increasing embrace of sex, eroticism, and romance threatens this rigidity, and the changing gender roles and sexual rules of recent decades created a “sexual panic” for evangelicals. The panic helps explain their virulent-beyond-reason hatred for Hillary Clinton, who embodied the sex-and-gender fears in her policies and in her very existence. Gay marriage engendered equally great terror among evangelicals, who sometimes saw it as threatening not only the family but the very foundation of our social structure. Birth control, the possibility of abortion, pornography, and even the mention of homosexuality or sex outside of marriage in sex education classes for children seemed like “gateway” drugs, opening the doors to sexual activity. And it was the evangelical owners of Hobby Lobby, the Oklahoma City–based chain of arts and crafts stores, that successfully got the Supreme Court to agree that their religious beliefs exempted them from having to participate in the Affordable Care Act’s requirement of contraception coverage.

These reactions seem to suggest a distaste for the sex-related behaviors themselves. But recall that conservatives have been found to show higher levels of repression of aggressive and sexual impulses. Perhaps the distaste for these broad societal changes is less a result of an actual distaste for sex and more because the biblically justified control over sex that they so loudly proclaim is, in fact, tenuous.

The internal conflict underlying superficial evangelical certainty about sexual immorality is exposed in a 2006 poll conducted by Christian.net, the world’s most visited Christian website, which found that “50 percent of all Christian men … are addicted to pornography.” Sixty percent of the women who answered the survey admitted to having significant struggles with lust and 40 percent of the women who responded admitted to being involved in “sexual sin” in the previous year. Over half of evangelical pastors surveyed in another poll taken in 2015 admitted viewing pornography in the previous year. The Bible Belt, the Southern and Midwestern parts of the U.S. where evangelical religiosity is strongest, leads the country in consumption of both gay and straight porn, and the parts of the country that are highest in religiosity have the highest rates of searching for sexual content online. In this context, it makes much more sense why evangelicals would be willing to brush off Trump’s affair with Stormy Daniels—they do the same for themselves.

Conservative evangelicals may also identify with Trump in other ways. They see him as embodying and expressing their own feelings. And it is less the content of Trump’s anger that many respond to than his anger itself and his aggression and his aggressive sexuality. Trump expresses less what many of his supporters think than what they feel, consciously or unconsciously.

White evangelicals voted for Trump because he was a conservative and a Republican. The sources of their conservatism are independent of their nominal religious beliefs (or, more precisely, their conservative politics and their religious affiliation stem from similar causes). They would have voted Republican if Roe v. Wade had never occurred. They would have voted for any other Republican. But if there was something special to them about Trump, it was that he expressed their own rage and their own disowned desires. To them, neither Trump’s often-expressed fear and contempt for people of color nor his retrograde attitudes and behaviors toward women were moral disqualifications for being president of the United States. If anything, they were qualifications.

Trump’s affair with Stormy Daniels is similarly not disqualifying—it is another way in which the identities of both evangelicals and conservatives strongly overlap in a time when identity dictates our political choices more and more. Why should their continued support be surprising?