We tend to think of our minds “wandering” as getting away from the task at hand and being a distraction from important work. But according to new research from the University of British Columbia, this is an essential part of how our brains work.

According to the researchers, a wandering mind is essential to dreaming and to creative thought. By allowing our minds to wander, we create new connections between ideas and thoughts that we might not otherwise have made.

“We propose that mind-wandering isn’t an odd quirk of the mind,” says Kalina Christoff, the review’s lead author. “Rather, it is something the mind does when it enters into a spontaneous mode.”

This spontaneity is essential to creativity.

The research also points to new ways to explore mental health issues like anxiety or ADHD. Essentially, these illnesses represent normal brain functions taken to extremes.

Someone with ADHD, for example, has a harder time paying attention and keeping their mind on task because it’s naturally inclined to wander more. A person with anxiety, however, is the ability to focus taken to extremes, to the point where it’s easy to obsess on potential catastrophes.

“Everyone’s mind has a natural ebb and flow of thought, but our framework reconceptualizes disorders like ADHD, depression, and anxiety as extensions of that normal variation in thinking,” says wandering mind review co-author Zachary Irving. “This framework suggests, in a sense, that we all have someone with anxiety and ADHD in our minds. The anxious mind helps us focus on what’s personally important; the ADHD mind allows us to think freely and creatively.”

“Understanding what makes thought free and what makes it constrained is crucial because it can help us understand how thoughts move in the minds of those diagnosed with mental illness,” says Christoff.

The review was based on over 200 other studies, which is how the researchers managed to piece together this new framework. In the future, further research could, and likely will, build upon these concepts in order to give us deeper insight into how illnesses like ADHD and anxiety work.