The Don Drapers of the world used to marry their secretaries. Now they marry fellow executives, who could very well earn more than they do.

With more marriages of equals, reflecting deep changes in American families and society at large, the country is becoming more segregated by class.

"It's this notion of this growing equality between husbands and wives having this paradoxical effect of growing inequality across households," said Christine Schwartz, a sociologist who studies the topic at the University of Wisconsin, Madison.

From Cinderella to Kate Middleton, fictional and real-life fairy tales have told of women marrying up. But it has been a long time since women said they went to college to earn a "Mrs. degree." In more recent cultural touchstones — like "The Intern," with Anne Hathaway, and "Opening Belle," the novel and soon-to-be Reese Witherspoon movie — the protagonists are highly successful women with husbands who don't work. (Spoiler alert: Conflict ensues.)

These changes have been driven by women's increasing education and labor force participation, new gender roles, and the rise of what social scientists call assortative mating.

Assortative mating is the idea that people marry people like themselves, with similar education and earnings potential and the values and lifestyle that come with them. It was common in the early 20th century, dipped in the middle of the century and has sharply risen in recent years — a pattern that roughly mirrors income inequality in the United States, according to research by Robert Mare, a sociologist at the University of California, Los Angeles. People are now more likely to marry people with similar educational attainment — even after controlling for differences between men and women, like the fact that women were once less likely to attend college.

Even though the typical husband still makes more than his wife, the marital pay gap among opposite-sex couples has shrunk significantly in the decades since women started entering the workforce en masse. Today, wives overall make 78 percent of what their husbands make, according to an Upshot analysis of annual survey data from the Census Bureau. That's up from 52 percent in 1970.

In opposite-sex marriages in which both spouses work some amount of time, 29 percent of wives earn more than their husbands do, up from 23 percent in the 1990s and 18 percent in the 1980s, according to the Bureau of Labor Statistics.

The marriage pay gap varies by education, profession and class. Husbands who are dentists have the greatest pay difference with their working wives, who earn 47 cents for every dollar their husbands earn. Generally, couples in which men have high-earning, white-collar jobs have the largest marital pay gap, while men in service jobs like bartending and child care earn less than their wives.

These differences have to do with the nature of the jobs. Hourly workers have a smaller gender pay gap in general. High-paying jobs generally have the least flexibility and the longest hours — which means someone has to pick up the slack at home, and families can afford for one spouse to work less.

The marital pay gap still exists in part because women earn less than men in the economy as a whole, making 79 cents for a man's dollar.

It reflects the stickiness of gender roles at work and at home: Marriage significantly depresses women's earnings, and the arrival of children has an even stronger effect. Men, meanwhile, tend to earn more after having children, and studies show that's because employers see mothers as less committed to work and fathers as doubly committed to breadwinning.

The nature of marriage itself is changing. It used to be about the division of labor: Men sought homemakers, and women sought breadwinners. But as women's roles changed, marriage became more about companionship, according to research by two University of Michigan economists, Betsey Stevenson and Justin Wolfers. Now, people marry others they enjoy spending time with, and that tends to be people like themselves.

"Husbands and wives had different roles in different spheres, so that was the opposites-attract view of marriage," Wolfers said. "Today you want people with shared passions, similar interests to you, similar career goals, similar goals for the kids."

Another reason people are finding mates like themselves is that they are marrying later, so they know more about their partners' prospects and increasingly meet at work. People were least likely to marry those with similar educational backgrounds around the 1950s, according to Mare's research, when people married very young. Americans are increasingly able to make their own romantic choices based on personal preferences, free from family or religious expectations, he found.

American society has also become more segregated geographically; people tend to live near others with similar educations and earnings. Researchers have linked the increase in so-called power couples, in which both partners have a college degree, to the fact that educated people are more likely now to live in big cities — so the people they date tend to be educated, too.

Technology could also play a role: Dating apps and sites let people filter their potential partners before they even have a conversation.

The change is happening internationally, too. In 40 percent of couples in which both partners work, they belong to the same or neighboring income bracket, up from 33 percent two decades ago, according to 2011 data from the Organization for Economic Cooperation and Development, which includes 34 countries. Two-thirds have the same level of education.

Despite being more common, these marriages are a break from tradition, and that can present problems.

Marriages in which the woman earns more are less likely to form in the first place, which accounts for 23 percent of the overall decline in marriage rates since 1970, according to a large study by the economists Marianne Bertrand and Emir Kamenica of the University of Chicago and Jessica Pan of the National University of Singapore. Using census data from 1970 to 2000, they analyzed the choices people made in so-called marriage markets, based on age, education, race and where they lived.

When such marriages do form, the women become more likely to seek jobs beneath their potential or to stop working entirely, and the marriages are more likely to end in divorce. Paradoxically, wives who earn more also do significantly more housework and child care than their husbands do, perhaps to make their husbands feel less threatened, the economists said.

Bill Doherty, a marriage therapist and professor at the University of Minnesota, said he had seen women who were more professionally successful than their husbands compensate by building up their husbands' careers and playing down their own.

"It's kind of like if he's shorter than she is, she doesn't wear heels," he said. "It's in the cultural DNA that if anyone should be bigger, richer, more successful, it should be the man."

When these couples struggle, it is often over issues like sexual desire or the division of housework and child care, Doherty said, particularly if the woman loses respect for the man and the man feels insecure about his role in the family.

Yet that dynamic seems to be changing, he and other researchers said, because young people have more egalitarian views about marriage and the division of labor.

Alena Taylor, 28, a management consultant, earns 40 percent more than her husband, Matt, 31, a nonprofit executive. "It has felt like a nonissue," Matt Taylor said.

They said they knew that conflict could arise over their division of labor when they have children, including because she travels more and he has greater flexibility. "Because my earnings potential is much higher than his, over time we'll have to figure that out," she said.

Researchers say the rise in assortative mating is closely linked to income inequality. The two have increased in tandem, Schwartz, the sociologist from the University of Wisconsin, said: "People who are married tend to be more advantaged, and on top of that, more advantaged people are marrying people like themselves, so those people tend to be doubly advantaged."

The effects could become more pronounced in future generations. Studies tell us that parents' income and education have an enormous effect on children's opportunities and achievements — and children today are more likely to grow up in homes in which both parents are more similar than they are different.