Yeah, this is a part of how our nervous system works. When we have focused attention, the patterns in our associative system are rigid. When we are waking up or falling asleep or daydreaming, the patterns become less rigid, so we make more novel associations.
It appears that the parts of the brain that are very active when we have focused attention are inhibiting the parts that are necessary for making very novel connections. By actively working on something, it appears that we prevent truly creative solutions from coming to us. (I mean "coming to us" metaphorically, since there are subcortical parts of the brain involved in making the novel connections, and when the information is carried to the neocortex, now it's in our conscious awareness and we get a sense of "it came to me from out of nowhere").
RE: How To Write Posts More Efficiently