When it’s not just a random thought from who-knows-where, most often it’s another thread or post that triggers some related (or not) question. If I can’t make a temporary side-track comment/question within the thread without running the risk of a full-blown hijack, I’ll try a new thread. Maybe half the time the new thread will see some action. It’s the times where the new thread just sits there with 0 replies from then on out, that I wish I had just asked when the idea hit me. Same net result, most likely.
If it’s a serious issue from some movie or TV show or something in the news then, of course, that’s going to be the source.
Most of my really off-the-wall ideas come in the toilet! And that’s not just SDMB ideas.
In the car, in bed before I fall asleep, or talking with people. A lot of things come up in conversation, and I know someone here knows, or is some kind of expert on it, I just almost always forget to post it.