Do you ever spend time living in your head? It's hard to explain to folks who've never done it - it's not antisocial behavior, more a refusal to be drawn any further than necessary into events around you. Life goes on, and you function in it just fine, but the real business of living is going on inside your head, where all sorts of things are swirling around.
For a while, life inside your head is more interesting than life outside of it.
In spite of the dancing, darting thoughts and ponderings, it's a peaceful place. No demands on you save those you chose to impose yourself. Half-formed ideas can be dropped, only to reemerge a day or so later in full bloom, having knit themselves together in the back recesses of your mind, all on their own.
There doesn't seem to be any specific catalyst for a period of head-dwelling; it happens when it happens, and goes away when it wills.
If you need me, that's where I'll be.