I'll give you an example; when I interviewed Pink Floyd's David Gilmour for Guitarist magazine a few years ago, I asked him about 'Shine On You Crazy Diamond' and he told me that the song began with the band jamming in a rehearsal studio and the famous four note 'chime' just 'falling out of my guitar...'. Apparently something in those four notes reminded Roger Waters of their fallen son, Syd Barrett and a piece of prog history began to form then and there.
Singer-songwriter James Taylor insists that he is merely a conduit for his songs and that they come from somewhere outside him, whilst other people I've spoken to will go from the mundane 'it started with a collision of two chords and then the hard work began to turn that idea into a whole piece' to the mystical 'I literally woke up one morning with the melody complete in my head. I don't know how it got there...'
Possibly the most humorous comment was from Peter Frampton, talking about one particularly inspired day of songwriting: 'I wrote 'Show Me The Way' in the morning and 'Baby I Love Your Way' just as the sun was setting... I'm still trying to work out what I had for breakfast!'
For my own part, I've just returned from a week in Cornwall and naturally I took a guitar with me (I'm finishing some pieces for my new album and so I can't afford to be sans guitar for too long at present). One morning a whole middle section of a composition I've been working on just happened; I just played it, whole and complete like I'd known it all my life – and I'll be darned if I can put into words what kind of cerebral process brought it into being. One thing I suspect was that with views from our rented cottage like this one...
...it's actually hard not to be inspired!