I find that inspiration strikes me in the form of "Moments"- kind of like snapshots of what a game should be and the reactions it should elicit from the player having the experience. Like Shadow of the Colossus' moment would be delivering the killing blow to a giant beast while hanging on for dear life- the feeling of victory against insurmountable odds, coupled with a constant acute fear of being thrown off and having to start over. The whole game is built off of those moments. I'm sure that the story was written to facilitate getting to have those experiences.
Sometimes the story is as much a part of those fundamental moments as the gameplay itself. for instance, none of Chrono Trigger's "Moments" are inside of a battle sequence. instead, they usually directly follow one. The feeling of wiping out an enemy with Luminare is totally trumped by that time when Chrono sacrifices himself in the battle with Lavos, or the face-off between Frog and Magus, or when Robo gets himself trashed by his own Robot friends. Those are story driven Moments- the gameplay serves to break up the plot, and uses the next chunk of plot as a reward for beating a boss or making it through a dungeon.
I've heard that music bands often have hundreds of song progressions without lyrics, and similarly hundreds of lyrics without song progressions. The lyricist might write words for a particular music track that he has in mind, or he might write something he feels is really compelling and spend time working out an appropriate track to put the words to.
Sometimes production works forward, sometimes it works backwards.