Good compositions are more likely than not a result of a prepared mind. And a prepared mind doesn't happen by accident. Alain's is a good ex post facto summary.
I'm not sure if you meant this as a contradiction or affirmation .... (/me scratches head)
I just believe, that what you call "being prepared" becomes more and more a subconscious process, and that this is not by accident or arbitrarily.
One might believe actions mainly controlled by subconscious processes are somehow "by accident", but that is not my position.
I simply think in an artistic process believeing ones ego controls what happens is an illusion, but we can somehow shape the process, so to say.
Still we can do something do improve, like reading and reflecting articles like Alans.
And of course: Go out and shoot ...
Actually Charlie Parker said something similar about Jazz:
"You've got to learn your instrument. Then, you practice, practice, practice. And then, when you finally get up there on the bandstand, forget all that and just wail."
and:
"Don't play the saxophone. Let it play you."