My pun in the 70s & early 80s was that I dropped two hits of blotter and worked backwards. . . (you really had to know me back then and how, a drop of my blood would stone most people)
I think that most such things come by two chief routes; Dreams that help me resolve act issues, and brainstorming sessions with my peers or for that matter, someone that has a general idea as to where they want to take things but not certain how to make it happen (I love to brainstorm). At the same time there is that "curse" many of us endure; when you see something and just know way deep down, that there is a trick within it that's just waiting to be born.
Sometimes we will fool ourselves however, by reinventing the wheel. I can't count how many times I thought (I knew) I had something novel only to find out that either, it already existed or worse, I'd already come up with but forgot about it (I do that a lot these days).