If you’re single, you can’t seem to get away from the couple who won’t stop cooing and talking about how great it is to be in a relationship and how relieved they are to be spared from the horrors of dating. And if you’re married, you can’t stop hearing from singles about how marriage is a hellish trap and their own commitment-free life is a blissful expression of their independence.

It may not make the annoying nature of your self-satisfied friends any easier to take but a new study may explain why people in relationships are so convinced that partners are the way to go, while those who are single adamantly refuse to accept the joys of being part of a pair. People who see their relationship status as unlikely to change are prone to idealize it— while those who are open to other possibilities don’t feel the need to boost themselves by disparaging the status of others. Understanding the psychology of this process can help explain a lot of otherwise mystifying behavior among both singles and couples.

The study, which will be published in Psychological Science, is based on the theory of “cognitive dissonance,” a phenomenon first described in the 1950s. If you are deeply committed to a belief and have acted in ways that you think are irreversible as a result, it’s often easier to change your other beliefs and actions than it is to question the original idea.

“Cognitive dissonance happens when we’ve made a choice and we’re not 100% satisfied with it or it goes against something we believe,” says Kristin Laurin, assistant professor of organizational behavior at Stanford University, the lead author of the study, “We feel uncomfortable, so what we do is adapt our attitudes so now the choice fits better with the attitude.”

The term was first coined by psychologist Leon Festinger, who studied members of an apocalyptic cult. After they had quit their jobs, cut ties with outside friends and family and sold their belongings, the predicted catastrophic flood failed to arrive. The leader gave them a lame explanation that it had been their faith that saved the world. But while some members did quit, many others became even more fervent, in a desperate attempt to justify their already-made decisions to dedicate their lives to the cult.

Festinger and his colleagues and students soon found that a similar reaction occurs in many cases where people have paid a high price for something that fails to deliver fully. In fact, these studies find that the more people pay for something, the more likely they are to see it as having been worth it. Whether it’s wine or a car or even a fraternity initiation, the more you pay in cash or emotional pain, the better you tend to feel about what you’ve gotten. (This is part of why hazing is so hard to eradicate: it does increase loyalty).

Laurin and her colleagues suspected that a similar thought process might take place when people consider their relationship status. If you believe you are likely to stay single, it can be easier to look on the bright side, rather than constantly spending time envying people in pairs. Similarly, if you think your relationship is going to last, it’s not a great idea to focus on the upside of being unpartnered.

Researchers tested these ideas in several experiments, one of which was conducted on Valentine’s Day two years ago. In that study, 113 college students were offered chocolates for answering survey questions about their current relationship status and whether they felt it was likely to last.

Then, they read a description of a student of the same gender, who was either single or in a relationship and were asked to write a few paragraphs about how they thought that person would spend Valentine’s evening. They also quantified how happy and fulfilled the person would be and were asked if they thought the student in the example would have a better evening if they had the opposite relational status to the one described.

As predicted, participants who saw their relational status as unlikely to change made more positive judgments about those who shared that status and were more negative about those who didn’t.

“The more the coupled people felt that their relationship was going to last, the more they wrote happy stories about relationships and sad, unhappy stories about being single,” Laurin says, “And conversely the more single people thought that they would be single for a long time, the more they wrote happy stories about single and sad, unhappy stories about relationships.”

These preferences may help explain why single people tend to find that their friends drop them when they couple up — and why couples who break up often find themselves excluded by their married friends. “I think that definitely contributes to the divide you see,” says Laurin.

However, the research did not find that couples were more likely to idealize their status than singles were — even when similar experiments were done with older adults, amongst whom being single is more stigmatized than it is in college.

“That was one of most surprising things we found,” Laurin says, “We thought that since there’s a prevailing cultural ideology that people should be in relationships, [it] might be harder for single people to say ‘Yeah, it’s totally awesome [being single],’ but we actually found exact same size effect across both groups.”

Other experiments explored whether cuing people to think about their relational status as more or less changeable would reduce the effect (it did) and whether being more satisfied as a single or coupled person would account for the idealization of one’s own status (it didn’t).

So whether or not you have someone to come home to on Valentine’s Day — take heart. Those smug married people or carefree singles don’t actually have it better— they just want to convince themselves that they do.