The Renaissance painter Albrecht Dürer was regarded by his friends as a master in the art of mind-wandering. He could become ‘enwrapped’ in his own pleasant reflections, wrote the German humanist Willibald Pirckheimer, at which times Dürer ‘would seem the happiest person on Earth’.

Many of us are familiar with mind-wandering in a number of guises: procrastination, reflection, meditation, self-flagellation, daydreaming. But while some mental meandering seems fruitful, on other occasions it has the unmistakeable bite of a bad habit, something that holds us back from reaching our full potential. Reverie can be a reprieve from reality and a font of inspiration, yes. But equally familiar is the mind’s tendency to devolve into sour and fruitless rumination when left to its own devices, especially when we’re in the grip of depression, anxiety or obsession.

Can art itself be a useful catalyst for nudging us towards more helpful emotions and mental states? Whether in the form of literature, rap or abstract oil painting, many of us know we can improve the tenor of our thoughts by contemplating art. The Germans have a lovely saying for the benefits of keeping an idle (or idling) mind: ‘die Seele baumeln lassen’, meaning ‘let the soul dangle’. Now, the emerging science of neuroaesthetics is beginning to reveal the biological processes that sit behind such ‘dangling’.

To begin with, contemporary cognitive science has presented a vast amount of evidence that mental states send and receive ripples of cause and effect across the rest of the body. Think how your mouth might water when you look at a photo of a tasty chocolate cake, or how tense you feel when watching a suspenseful TV drama. Thoughts, feelings and emotions, whether aimless or deliberate, are a somatic cascade of multiple biological events. And it’s this cascade that art somehow taps into.

Galen, the second-century Greek physician, was well aware of the connection between mind and body. He believed that mind-wandering was the result of physical and mental lassitude, and so prescribed a regime of logic and hard, structured work to avoid it. ‘Laziness breeds humours of the blood!’ Galen is believed to have said. The assumption here is that concentration is a kind of psychobiological discipline, something we have to work at to stop our wayward minds and bodies from veering out of our control.

However, there’s an even older tradition from Ancient Greece that views daydreaming as a boost to our wellbeing. Galen’s Hippocratic forebears argued that mind-wandering was in fact the best strategy for guiding us back into healthy states. And modern-day research in developmental psychology has shown that children and adults who engage in certain kinds of mind-wandering actually display more cognitive flexibility, and perform better when called upon to exercise ‘executive’ functions such as problem-solving, planning and managing their own thoughts and feelings.

Neuroimaging – a method of ‘seeing’ the brain in action – has started to reveal the brain processes that correlate with these mental states. Far from falling idle, the brains of people asked to stay still and think of nothing in particular continue to fizz and pop in patterns of activity known as the default mode network (DMN). These activations are closely related to those engaged during self-referential thinking, the experience of the self, and intuition. Moreover, they are observed alongside activation patterns in the prefrontal cortex (PFC) – the area typically associated with those important ‘executive’ functions. Strikingly, the greater the strength of the relationship between these two domains of the brain – intuition and executive function – the more creativity a person tends to display when asked to solve a problem. Brain scans demonstrate correlation, not causation; but even so, they hint at the possibility that reverie might help to prime us to think both productively and creatively by somehow cementing our sense of self, drawing body and mind together in a train of thought and biological action.

Art can be a catalyst for this sort of reverie, as well as a tool to regulate and control it. Both the basic properties of art (whether it’s in a minor or major key; the colours of a painting), as well as the complexities of its content (the lyrics of a song, the facial expression of a person in a painting), can induce reflections and emotions – and will invariably affect our body’s physiology. Thinking creatively, and engaging with works of art, have both been correlated with DMN activity – especially when people report that the aesthetic experience was particularly strong and meaningful to them. In these moments, our encounter with art seems to trigger an autobiographical daydreaming, a flow experience with a ‘me factor’.

Of course, art can also provoke unhelpful ruminative urges. Listening over and again to that song might not help you get over a heartbreak. But art-induced sadness doesn’t always make you slide into negative mental loops. In fact, art can help us adapt to the immediate source of pain by acting as a prop for emotional catharsis. We all know the strange, pleasurable, consoling feeling that comes after having a good cry. This experience appears to be precipitated by the release of the hormone prolactin, which has also been associated with a boosted immune system, as well as bonding with other people. The arts are a relatively safe space in which to have such an emotional episode, compared with the real-life emotional situations that make us cry. Even sad or otherwise distressing art can be used to trigger a kind of positive, psychobiological cleansing via mind-wandering.

History is full of examples of the relationship between reverie and creativity. Here is one, idiosyncratic example: the German art historian Aby Warburg (1866-1929) organised his library of 50,000 books with the aim of promoting mind-wandering. His collection was the kernel for the Warburg Institute in London, where we now work as researchers. Each of the library’s four floors is devoted to one of four themes – image, word, orientation, and action – and separated into sub-themes, such as ‘magic and science’, ‘transmission of classical texts’, and ‘art history’. Guided by Warburg’s ideas about what makes a good neighbour for a book, this unique approach to classification allows a withered 17th-century medical tome to cluster next to texts on mathematics, the cosmos and harmony. The shelves promote intellectual serendipity as you skip from the book (or thought) you thought you wanted, to another intriguing idea or topic that hadn’t even occurred to you.

Art appreciation is held in high esteem in most cultures and societies. It is often portrayed as a laborious cognitive exercise, but this is to forget that the arts provide an opportunity for intense emotional experiences, positive mind-wandering and psychobiological self-regulation. Dürer perhaps captures the activity of such inactivity best of all. ‘If a man devotes himself to art,’ he wrote, ‘much evil is avoided that happens otherwise if one is idle.’