No one knows exactly how and why creativity occurs. A lot of people have guesses. Some people have research. Some people have experience. But no one really knows.
However, there is one phenomenon that is an (almost) universally experienced vessel of creative inspiration: the shower thought.
Blame it on the calming, hypnotic sensory static of water on skin. Blame it on the period of subconcious incubation between workloads. Blame it on the shear freedom of nudity, or blame it on all of the above. There is something about taking a shower that helps the human brain do what it needs to do.