I think a bunch of things that people often classify as "luck" should really be looked at as timing issues.
Part of building a business is understanding market conditions and competition. I get that things can come completely out of left field, but there are different degrees to which you can monitor competition and how receptive people will be to your product or service. It's dangerous (and potentially fatal) to be head down building your product and ignoring looming threats.