Enshrined in the Ten Commandments, the adultery taboo has persisted throughout human history. According to the past 30 years of the General Social Survey (GSS), three out of every four American adults aver that extramarital sex is always wrong. At the other end of the spectrum, under three percent of the population thinks extramarital sex isn’t wrong at all. The number of Americans who report actually having sex outside the bonds of matrimony has held relatively steady, at around 16 percent. Annual fluctuations have been minor, rarely exceeding more than a percentage point in either direction. At first glace, it seems like America has made up its mind about extramarital sex.

But the broader trend has obscured startling changes: since 2000, older Americans are cheating more, while younger Americans are cheating less. These numbers are derived from GSS responses to this survey item: “Have you ever had sex with someone other than your husband or wife while you were married?” Survey respondents have been asked this question in each survey wave since 1991.

The growing age gap in extramarital sex is depicted in Figure 1, below. For the first few years of the millennium, there were scant age differences. Starting after 2004, Americans over 55 began reporting rates of extramarital sex that were about five or six percentage points higher than were being offered by younger adults. By 2016, 20% of older respondents indicated that their marriages were nominally adulterous, compared to 14% for people under 55. Most married Americans remain committed to monogamy, but the mounting age difference is noteworthy and statistically significant. Additional analysis suggests that the age difference cannot be explained by fundamental sociodemographic differences between respondents, including sex, age, race/ethnicity, or education.

Figure 2, below, suggests that the trend toward extramarital sex is being driven by people in their fifties and sixties. Additional analysis of the GSS data reveals that most of these people have been married for between 20 and 30 years. Once survey respondents enter their seventies, rates of extramarital sex decline considerably.

Another way to look at the Figure 2 data is by birth cohort. We know that the lion’s share of people in the 18-29 age range were born in the 1980s, most people between 30-39 were born in the 1970s, and so on. Perhaps the propensity for extramarital sex is a product of what people experienced while growing up, not a question of how old they are. As we might expect, Figure 3 is a mirror image of Figure 2. People born between 1940 and 1959 report the highest rates of extramarital sex. These are the first generations to come of age during the sexual revolution, so it’s understandable they are more likely to have sex with someone without their spouses. They may have firsthand experience with 1970s-era experiments with nonmonogamy. A few people born in the late 1950s may have had swingers for parents, leading offspring to question taboos surrounding infidelity.

Two other insights about extramarital sex can be gleaned from Figures 2 and 3. The first concerns the chances that a marriage dissolves once a spouse has had sex with another person. The gap in extramarital sex rates between people who remain married to their first spouses and people who’ve ever been married (i.e., including people who’ve stayed married and their contemporaries who married and divorced) is largest for GSS respondents in their fifties and sixties at the time they’re interviewed (no such gap appears in Figure 3). The obvious implication is that this is the age range at which extramarital sex is most likely to precede the dissolution of a marriage (adultery seems to be both cause and consequence of a failing marriage). In contrast, survey respondents who are younger (30s and below) or older (70s and up) are less likely to dissolve their marriages in the wake of extramarital sex.

The second insight is more complex. Do people in their fifties and sixties have the most extramarital sex because they’re in midlife and have been married for 20-30 years, or because they came of age at a time that fostered greater sexual exploration? The answer is probably “both.”

The question reflects a broader dilemma of how to interpret trends referred to by social scientists as the age-period-cohort problem. Age is self-explanatory. Period reflects the social influences people experience at the time they’re interviewed for the General Social Survey. Cohort, more properly known as birth cohort, refers to what people experience while growing up. Each dimension of time—age, period, cohort—may potentially have a distinct effect on people’s propensities for extramarital sex. Yet it is often impossible to distinguish the three.

People in their fifties and sixties, coming of age in the wake of the sexual revolution, have had more sex partners in their lifetimes than their older or younger compatriots. And after peaking around 1990, teen sex has dipped significantly. Collectively, this sexual biography makes it understandable that products of the sexual revolution would be most predisposed to extramarital sex. If people just aged into outside love affairs, presumably as they grew bored of their marital beds, we could expect that the oldest GSS respondents would be the most likely to report extramarital sex. But Figure 2 suggests this isn’t the case.

Why do I say “suggests”? Perhaps some people do become more likely to have outside sex partners as they age, but only if they grew up during the sexual revolution of the 1960s and 1970s. Age and cohort effects may work hand in hand to explain the diverging trends in extramarital sex. These developments may be abetted by changing attitudes (in other words, period effects). Analysis based on sociologist Yang Yang’s intrinsic estimator, a complex statistical model for age-period-cohort data, favors the role of age in explaining higher rates of extramarital sex. Still, Figures 1 and 2 suggest that age by itself isn’t enough: older Americans only became more sexually active outside marriage in recent years.

One inducement to do so may have been the proliferation of Viagra and other medications for erectile dysfunction, which only came on the market 20 years ago. Period effects can also be assessed by looking at how sentiments about extramarital sex have changed. Figure 4 tracks these attitudes between 2000 and 2016 for different age groups of survey respondents. Collectively, we still disapprove of sex outside of wedlock, but we disapprove less strongly than we used to. Interestingly, this shift has been greatest for older Americans—people in their sixties, seventies, and eighties. Conversely, the only adults who’ve grown more disapproving are those in their fifties, and to a lesser extent, their forties.

Recall that the fifty-somethings had some of the highest rates of extramarital sex. Either people’s attitudes don’t match their behavior—a classic story in the social sciences—or we’re witnessing sexual inequality: while some Americans have more sex out of wedlock, others have grown more disapproving. Indeed, perhaps some of this disapproval reflects the comparably high rates of extramarital sex 50-somethings and 60-somethings have been observing in their peers.

This isn’t hard to believe given how balkanized American society has become. Indeed, it may figure into how people answer when the GSS queries people about nonmarital sex. Although this probably means adultery most of the time, the wording doesn’t rule out polyamory or other forms of consensual nonmonogamy. Even as most people continue to disapprove of anything but monogamous marriage, others have found unprecedented venues for sexual exploration.

No authoritative estimate of nonmonogamous relationships in the United States exists. On the basis of extrapolation, one researcher estimated a consensually nonmonogamous population of 9.8 million. I suspect this number is on the high side. Still, millions of married Americans could be in open relationships. This trend is likely abetted by the burgeoning public interest in ethical nonmonogamy (that is, extramarital relationships conducted with the explicit consent of one’s spouse). As an institution with self-help books, Internet forums, and support groups, polyamory came into being less than 30 years ago. Based on Google Books data, interest has soared.

Can polyamory help explain growing rates of extramarital sex among middle-aged Americans? It’s impossible to know with these data. It’s also unclear whether the option of an open relationship keeps some marriages together. One recent study based on national data did show that extramarital sex doesn’t raise divorce rates when both spouses are participating. On the other hand, Figure 2 suggests that sex outside of marriage is most likely to lead to divorce among the very same age groups that have the highest levels of extramarital sex. No matter how many polyamorists there are nowadays, old-fashioned adultery probably has risen among older Americans.

The consequences are plain, even if the causes are uncertain. Even as overall divorce rates have fallen in recent decades, there has been a startling surge in “gray divorce” among the middle-aged. Part of that story seems to be a corresponding increase in midlife extramarital sex. The seeds sown by the sexual revolution continue to bear unanticipated fruit. But given the declines observed for younger Americans, barring any unforeseen developments, we should anticipate a future of more monogamous marriage.

Nicholas H. Wolfinger is Professor of Family and Consumer Studies and Adjunct Professor of Sociology at the University of Utah. His most recent book is Soul Mates: Religion, Sex, Love, and Marriage among African Americans and Latinos, coauthored with W. Bradford Wilcox (Oxford University Press, 2016). Follow him on Twitter at @NickWolfinger.