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 (who also contributes to The Upshot). 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,” Mr. 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 Mr. 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.