Some of what passes for "inspiration" is repurposing melodic fragments, chord changes, modulations, etc., that you've heard or played before. We all know I-IV-V-I, and ...ii-V-I seems even more natural; we all use them.
That doesn't mean or even suggest that a song can't develop spontaneously. I don't know of any songwriter's credible claim that a song "wrote itself", but sometimes the initial spark (observation, phrase, etc.) suggests a storyline that the writer expands to a conclusion very quickly.
The challenge is to use those familiar progressions while adding unusual variations, that aren't unacceptably jarring, to catch the listener's ear. That goes for lyrics, too, where (for example) you can twist a familiar expression in an unexpected direction.
For the vast majority of the time, it's just plain work, and you think and think until you devise ideas that you can flesh out and make usable.