From neuroscience, there's the default mode network.
https://en.wikipedia.org/wiki/Default_mode_network
> It is best known for being active when a person is not focused on the outside world and the brain is at wakeful rest, such as during daydreaming and mind-wandering.
Apparently, activation of the DMN is correlated to rumination, itself correlated to depression.
https://pubmed.ncbi.nlm.nih.gov/31655111/
Interestingly, one thing often suggested to counter depression these days – meditation – generally says right on the tin that you're supposed to get into a wakeful rest state, but specifically try to avoid daydreaming and mind-wandering.
(I should say that I'm no expert. Just passing along things that I've heard/read.)
Edit: formatting