Say you’re listening to the radio on your way to work, and a favorite song from 20 years ago starts playing. A sense of wistfulness overcomes you, evoking fond memories of the past. A familiar smell can elicit a similar sensation, as can a movie resurrected from childhood (Jurassic Park, anyone?). The feeling is bittersweet, though ultimately pleasant. Sound familiar? You’ve experienced nostalgia.

“When you’re nostalgic about something, there’s a little bit of a sense of loss—[the moment has] happened, it’s gone—but usually the net result is happiness,” says Clay Routledge, a social psychologist at North Dakota State University, who, with several other researchers, has studied the emotion extensively over the past decade. The team has found that nostalgic memories typically entail cherished, personal moments, such as those spent with loved ones. Those memories, in turn, inspire positive feelings of joy, high self-regard, belonging, and meaningfulness in life.

While certain smells or sights inspire nostalgia, less obvious triggers—borne from the mind rather than the environment—seem to be more frequent and powerful, according to work done by Routledge and colleagues. In two experiments, for example, they asked participants to describe situations that caused them to experience nostalgia and found that negative feelings, and specifically loneliness, were cited most often. In another experiment, participants read one of three news stories that contained depressing, neutral, or positive content. A story about a tsunami disaster provoked more nostalgic thoughts than an article about space or a polar bear birth, the researchers found.

Low self-esteem or a sense of despair over life’s meaning can also drive nostalgic musings. When suffering the existential blues, “People don’t just go back and recruit random memories of driving to work or paying taxes,” says Routledge. “They think about the special times. They think about the times they’ve spent with close friends or loved ones, maybe that family reunion, maybe important rituals—their wedding or graduation.”

Nostalgia, then, seems to be one way that people cope with various negative mental states, or “psychological threats.” “If you’re feeling lonely, if you’re feeling like a failure, if you feel like you don’t know if your life has any purpose [or] if what you’re doing has any value, you can reach into this reservoir of nostalgic memories and comfort yourself,” says Routledge. “We see nostalgia as a psychological resource that people can dip into to conjure up the evidence that they need to assure themselves that they’re valued.”

So, do some people experience the emotion more than others? Most of us probably wax nostalgic at least a few times a month—and often more than once a week—according to Routledge, although older adults might be more prone to bittersweet longing, he says. And recent work by Routledge’s lab suggests that people who are highly anxious or who worry a lot also tend to be more nostalgic, perhaps because pleasant reflections alleviate their neuroses. (His lab is continuing to explore that theory, as well as investigating whether nostalgia can be invoked to help sufferers manage stress when social support is unavailable.)

Given the recent research, it may seem incredible that nostalgia was once considered a psychiatric disorder. Nowadays, however, it seems that living in the past isn’t so bad after all.