When it comes to capturing that great shot there is no substitute for a good moment. You just have to get lucky. Or do you? Louis Pasteur said once that "In the field of observation, chance favors only the prepared mind."
You take enough photos (or really do whatever you do: code, read, run, and so on) and you just come to a mental state where seemingly casual observations have great meaning to you and then you almost out of subconscious leap to take advantage of it . Sort of like Malcolm Gladwell's 10,000 hours theory (or really Dr. Anders Ericsson theory that Gladwell popularized.)