Like I keep saying, the best designs occur in the theta state. This is when your brain waves are between 4Hz and 6Hz. This often occurs when you are relaxed and halfway between dreaming and awake, but can occur anytime, even in the shower.
This is when your subconscious has been working on a problem you are dealing with, and a sudden flash of inspiration shows you the perfect solution. It is by no means an accident, as some propose.
Techniques exist to improve the links between the subconscious and active minds. These can be learned and taught, and can be a simple as shifting your attention from the problem you are working on to a different one. When you return to the original problem, you may see it in a completely different way as your subconscious has had time to sort out all the issues and give you a clearer picture of the solution or the path to find it.
The important thing is to recognize the power of the subconscious, and the value of finding new ways to link to it.