It’s Pride Month and President Obama wants you to know it.

The U.S. Postal Service just issued a Harvey Milk stamp. Laverne Cox is on the cover of Time magazine. Michael Sam kissed his boyfriend on national television when he was drafted into the NFL last month. The National Parks Service just launched an initiative to mark prominent places and events from LGBT American history.

To anyone who’s been paying attention, it should be obvious that our country has undergone rapid, sweeping cultural change over the past 4 or 8 or 12 years regarding how we think about gay rights. Gallup poll data shows that 58% of Americans believe that gay and lesbian relations are morally acceptable, up from 38% in 2002, and 54% now believe that same-sex marriages should be recognized by the law, with same rights as traditional marriages, up from 37% in 2005. And a whopping 90% of Americans support protections from discrimination for gay and lesbian employees.

But what’s driving the trend? And will it last? 

Patrick Egan

Divining the answers to those questions can be a little like reading tealeaves. So for some concrete, fact-based insights, NYU Stories turned to Patrick J. Egan, a stats-minded politics and public policy professor who’s spent a lot of time studying fluctuations in public opinion. A leading researcher on what led voters to pass Proposition 8 in California, he’s also the author of a book on issue ownership, or the tendency of voters to identify certain causes with certain political parties.

Egan dates the start of the move toward widely held liberal attitudes on gay rights to the 1970s—but notes that the AIDS epidemic of the 1980s dampened what might otherwise have been a quicker progression. The pace of change picked up in the ’90s (after antiviral therapies began to curtail the AIDS death toll, Egan points out), stalled briefly with a conservative backlash to the Supreme Court’s decision (striking down all remaining state laws that criminalized gay sex) in Lawrence v. Texas in 2003, and accelerated rapidly in recent years, with an indisputable majority of Americans now even supporting adoption rights for gay people. “It’s really been quite an amazing change,” Egan says, “and one whose swiftness we hardly ever see in aggregate public opinion trends in the U.S.”

Two primary factors are driving the shift. One has to do with the overwhelming support of gay rights by members of the millennial generation, who are joining the electorate as older voters who hold more conservative views on the issue die off; experts like Egan call this effect “cohort replacement.” In other cases, Americans are simply changing their minds—a phenomenon reflected in panel data collected from individuals surveyed repeatedly over time.

While we’ll never know exactly what’s swaying individual hearts and minds, the evidence suggests that some Americans—particularly Democrats—who’ve moved in favor of gay rights over the past 10 years may have taken their cues from political leaders. “In political science,” Egan explains, “probably the number one source of attitude change on any issue—from taxes to the Iraq war—is what elites say about it.” And among the Democratic party elite, the shift has been dramatic: In the 2004 Democratic primary, Egan points out, the controversial question was which candidate would support civil unions for gay people; looking ahead to the 2016 race, all of the Democratic presidential candidates will support same-sex marriage. Of course, politicians adjust their positions to the whims of public opinion, too—often leading, as in the months approaching President Obama’s public endorsement of marriage equality, to a kind of game of “chicken.”

And these days, Republicans are also getting in on the act: Egan points to a “small but substantial group” of leaders—from former vice president Dick Cheney to Ohio Senator Rob Portman and Mary Bono, a former Congresswoman from California—who are “breaking the party’s Orthodoxy” by speaking out in favor of gay rights. In February, Republican Arizona governor Jan Brewer vetoed a bill that would have allowed business owners to refuse service to gays and lesbians on religious grounds. At the same time, Egan says, the party—like the country at large—is split along generational lines, with young Republicans beginning to embrace same-sex marriage. It’s a rift, he predicts, that will eventually lead the party to abandon opposition to gay marriage as one of its signature issues.

If there’s a precedent for all of this, it’s the decades-long progression toward near universal acceptance of interracial marriage: In fact, the map of where interracial marriage was legal in 1951 is strikingly similar to the map of where same-sex marriage is legal today. “The parallel has a lot of intellectual force and also moral gravity,” Egan says. “Are you going to legally recognize these people who are willing to make a lifelong commitment to one another, or are you going to use the force of law to render that commitment null and void?”

While it’s inspiring to witness a growing number gay marriage bans going the way of anti-miscegenation laws, it’s also curious that our political geography—as represented in those near-identical maps—has changed so little in more than 60 years. When asked why the states that opposed interracial marriage are the same ones where marriage equality struggles to gain traction today, Egan points to two demographic factors that make a difference when it comes to tolerance: religiosity and educational attainment. Over 60 years, most places haven’t changed much on those variables: States where populations tend to support gay marriage (like they did interracial marriage) boast higher levels of educational attainment and lower levels of religiosity than those that oppose it.

And as for millennials? Compared to their parents, they’re less invested in religion—and in institutions of all kinds—and they’re the most highly educated generation in U.S. history. Add to that the fact that a growing number of religious institutions have shifted on gay rights issues—even the Mormon Church has withdrawn its once generous financial support from groups opposing gay marriage—and it would seem that we’re about to reach some kind of tipping point.

That’s not to suggest the going will be easy: “In socially conservative states like Alabama or Nebraska or Wyoming, it’s going to take a very, very long time, if trends persist, to get majorities on gay marriage,” Egan says. And then there’s a question of a national standard that would allow married gay couples to be recognized in every state. Loving v. Virginia, the 1967 Supreme Court decision that invalidated legal prohibitions against interracial marriage, came at a time when most states had already abandoned their miscegenation laws. “It may be that a similar story will take place for gay marriage. Does the Supreme Court want to impose a 50-state standard now, or much later when gay-marriage bans are seen more as an anachronism?”

Egan predicts that in 20 years, national law and policy on gay rights will resemble that of Massachusetts today: Same-sex marriage will likely be legal and recognized throughout the land, and there will be laws in place to protect gays and lesbians from discrimination in a variety of realms. And yet as any child of the civil rights era can attest, the culture often lags behind the law. Racial prejudice did not end with laws that prohibited discrimination, and segregation in housing and education persists, to some degree, even to this day. Likewise, Egan muses, if you “asked gay people in Massachusetts where they’d feel comfortable holding their spouse’s hand, they could probably identify only about 6 blocks within the whole state.” 

Follow Patrick Egan on Twitter.