Gilovich’s study also found that “the passage of time often brings with it increased confidence that one could have performed an earlier task successfully.” That confidence may be misplaced; people do tend to overestimate how much they can control situations. But while it’s hard to say how much of the world’s regret is wasted on unchangeable things people wrongly believe they could have controlled, in Gilovich’s study, at least, “only 10 of the 213 regrets involved outcomes caused by circumstances beyond the person's control.”

“You certainly can feel a host of bad emotions for things that were visited upon you,” Gilovich says. “Like ‘I was born in a generation where everyone was called to war.’ But people [generally] don’t want to apply the word ‘regret’ to that. It’s more that they rue that period. They wish it weren’t so.”

This element of control has borne out further in more recent research by Neal Roese, a professor of marketing at Northwestern University, who has found that people’s biggest regrets tend to come from areas of life where there was, or is, high opportunity for change.

“There’s two sides to this idea of opportunity,” he says. “The first part is focusing on what things were under your control in the past—what I could have done? How I could have made a difference?”

The second part is that people tend to regret more intensely mistakes that they still have the opportunity to change. If you regret not going to school for another degree, for instance, you may regret it more each year that you don’t do something about it.

“If it’s something that’s really done and you’ve reached a state of closure, you find yourself becoming more reconciled to it,” Roese says. “But when there’s still an opportunity to fix things, then our powers of rationalization are put aside. It’s kind of like the regret is a reminder to get off your duff and do something.”

Rationalizing and analyzing and imagining are all necessary for regret, which is a cognitive emotion, unlike something more primal like fear. If humans weren’t able to imagine other possible worlds than the one they live in, they wouldn’t be able to regret things.

In psychology, contemplating “What if?” is known as “counterfactual thinking.” “Upward counterfactuals” compare reality unfavorably to an imagined alternative—for example, “If I hadn’t been sidetracked by such and such job, I would have been an Academy Award-winning actress,” offers Laura Kray, a professor of leadership at the University of California, Berkeley. “Downward counterfactuals,” meanwhile, favor reality—something like, “My job might be difficult, but at least it’s not as hard as coal mining.”

While too much upward counterfactual thinking (and regret) has been associated with anxiety and depression, it also plays a key role in problem-solving, achieving goals, and improving behavior. “When we think about how an event could have been better, we may experience feelings of regret, but the upside to those feelings is it enables us to make better decisions going forward,” Kray says. “We’re more likely to learn from our experiences when we consider a better possible world.”

Regret, in other words, is an unpleasant but necessary byproduct of psychological processes that help us grow and thrive. “If the cost of that is some of the unpleasant stew that we have to sit in, then so be it,” Gilovich says.

And what about all those people who like to proclaim that they live with no regrets?

“I don’t think we really believe those people,” Gilovich says. “To live is to have at least some regrets, and if you don’t, there’s a concern that maybe you aren’t learning sufficiently.”