You’ve probably heard the story from a friend before: She’s been in a long-term for relationship for years, and she knows it’s not working. But she won’t end it. Her argument? She’s invested too much—energy, emotion, even money—to let go of what’s she’s built. Psychologists have a term for her thinking: It’s called the “sunk cost effect,” and in a study published in Current Psychology, they postulate that this reasoning traps people in unhappy relationships.

The study’s authors, a group of psychologists at University of Minho in Portugal, write that the sunk cost effect comes into play when “a prior investment in one option leads to a continuous investment in that option, despite not being the best decision.” They conducted two experiments to study the role of the sunk cost effect on committed relationships.

In the first, psychologists presented 951 participants with four scenarios in the life of a hypothetical couple. In the time scenario, the couple had only been married a year; in the money scenario, they invested all their assets in buying a house together; in the effort scenario, they’ve expended significant emotional energy trying to repair the relationship (there was also a control). The participants had choose whether to stay in the relationship or end it. The results showed that people were more likely to choose to stay together when “money and effort, but not time, had been previously invested in that relationship.”

In the second experiment, 275 participants were again given two hypothetical relationships to consider: a marriage of one year and marriage of 10 years. Instead of choosing whether to simply to stay in the relationship or end it, they had to choose how much time they would be willing to invest in the other person by marking a ruler labeled with “no time” and “a lot of time” on either end with the number of days and months marked in between. Participants in both scenarios marked near the halfway between the two ends, but “participants were willing to invest more time in a relationship” when a significant amount of time had “already been invested.”

So what does all this mean? According to the authors, “Both experiments confirmed the initial hypothesis that investments in terms of time, effort, and money make individuals more prone to stay and invest in a relationship in which they are unhappy.”

It’s a frightening thought, and it raises a lot of questions about why people choose to stay together. Do humans settle for discontent, a lack of intimacy and constant arguments because the thought of starting over again is just too daunting? Maybe being in love isn’t the key to staying together. Maybe it’s buying a house.