Men and women who looked at attractive members of the same sex reported stronger religious feelings than those who checked out prospective mates or just filled in the survey. They were more likely to say “I believe in God” and “We’d be better off if religion played a bigger role in people’s lives.”

“It’s an interesting and surprising phenomenon,” says Kenrick, who speculates that people ramp up their belief in a system that tends to enforce monogamy when they’re confronted with fierce sexual competition. It might have been expected, for example, that people are more religious when they are young, when they have to compete more for sex. “People actually switch on and off their religious beliefs over their lifetime to fit the current mating context they’re in,” he adds.

Sexual strife might not be the only reason people dial up and down their belief in God. Another new report pins changes in religious belief on anxiety.