Do you know what it's like to wake up with an unknown melody playing in your head? I'm not sure if this is a special feature of songwriters or if it develops and you continue to work in the field, but I've heard of other writers mention it, that something is playing in their mind. It's like having a song stuck in your head, but the song doesn't exist yet, so there are no exact words to hum, or hear, and no other parts to move to. It's just this collection of emotions, a feeling, playing in your head, sometimes with rhythm, like a snare or some kicks.
The task then becomes to try and identify the key, and the chords. Where does this sit and how can I play it? It is a bit of trial and error but of course, the more you do it the better your ear becomes and the easier it becomes. It's really just a feeling, a strong feeling. Some people see colors in their minds, I hear music.
Of course, I like to believe that it is original music. I am always cautious to take a moment and try to identify if this is something I've listened to recently, or heard overhead somewhere. Now I'm not shazam so I probably wouldn't know, and even if it does exist, I am most likely not going to reproduce the current song, especially if I don't know what it is. This could be now unintentional inspiration. I believe that these audio visions are most likely an amalgamation of music I've been listening to lately, combined with the emotions I'm feeling. I think it is my subconscious mind expressing my mood and feelings of the moment.
Once you translate this into actual chords and notes, it can be analyzed more practically. Now I can see what topics I'm thinking about that fit this progression or piece. From there I can develop other parts and a song.
One day I woke up with something in my head, this movement, it was like synth parts that I was hearing, and I liked it. I didn't have time to try and get it down but the next day, it was there again. Again, it was a busy week and so I didn't have time to find the chords I was hearing but still, for over a week, everyday when I woke up it was there. At that point the pressure was off. I understood that this music was just going to be there, perhaps forever, and I need not hurry to get to work. Eventually like 10 days in I sat down with my guitar and got the essence down. Shortly after, someone close to me left this world which made a deep impression on me. I had this progression with that emotion and wrote "never again". Once I got it out, the morning hallucinations stopped.