It has nothing to do with getting clean—and everything to do with your state of mind.
If you’ve ever emerged from the shower or returned from walking your dog with a clever idea or a solution to a problem you’d been struggling with, it may not be a fluke.
Rather than constantly grinding away at a problem or desperately seeking a flash of inspiration, research from the last 15 years suggests that people may be more likely to have creative breakthroughs or epiphanies when they’re doing a habitual task that doesn’t require much thought—an activity in which you’re basically on autopilot. This lets your mind wander or engage in spontaneous cognition or “stream of consciousness” thinking, which experts believe helps retrieve unusual memories and generate new ideas.
Source: The science of why you have great ideas in the shower