Sometimes when our minds wander, it can feel like a failure — we suddenly realize our thoughts have taken a walk without our even being aware of it instead of concentrating on the task at hand. Other times, letting our minds wander can feel good, since it can lead to creative breakthroughs.

And in fact, depending on what sorts of tasks we are doing, mind-wandering can be unintentional or intentional, a new study has found.

If we’re circling around a creative breakthrough, sometimes the mind needs to have free rein to get there.

In order to see if there are different kinds of mind-wandering, researchers at Harvard University and the University of Waterloo had college students take part in computer tasks that were easy or difficult, and so required varying amounts of attention. Every so often they interrupted the participants and had them rate how concentrated they were, and whether their minds were wandering either intentionally or unintentionally.

Participants reported about the same amounts of mind-wandering whether the task was difficult or easy — but the type of mind-wandering was different. Those completing the easier version reported more intentional mind-wandering; those who did the harder version had more unintentional mind-wandering. And this difference suggests that we may engage in each for different reasons.

“These results challenge the common view that all mind wandering is unintentional,” said researcher, Paul Seli, in a news release. “…[I]ntentional and unintentional mind wandering are unique cognitive experiences that sometimes behave differently.”

It seems that when we’re engaged in an easy task that doesn’t take much mental energy, we may intentionally wander away from it mentally to give ourselves something more interesting to think about. But for tasks which require more cognitive energy, mind-wandering is something we do by accident.

A wandering mind may be a reflection of a person's emotional state. One study found that when people’s minds wandered, they reported being less happy than when they were focused on their task.

Based on the current research, we may really need to differentiate between mind-wandering by accident and mind-wandering on purpose. Were the subjects' minds in the earlier study wandering because they were unhappy, or were they unhappy because they didn't care about what they were doing?

“The general assumption has been that people’s experiences of mind-wandering exclusively reflect their attention unintentionally drifting away from a task,” said Seli. “Based on our everyday experiences, however, it seems that people frequently intentionally mind-wander.”

There’s definitely something to be said for letting our minds wander a bit — either for the purpose of amusing ourselves during boring tasks or for the purposing of generating ideas. Though mind-wandering may feel pretty bad at times — for instance, if we’re ruminating about stressful events — it can also feel very good. If we’re circling around a creative breakthrough, sometimes the mind needs to have free rein to get there.

The study is published in the journal Psychological Science.