luck in combination with the Max Strategy (continually trying different things all the time):
a lot of products did not identify their use before hand, or their real use was discovered accidentally after they were made.
post it notes - started as a failed adhesive. a coworker found that it worked well using it with paper and a gospel hymn book
snood - (a very popular puzzle bobble variant) the programmer made it because he was bored in grad school
linux - started as a hobby by a bored phd candidate
silly putty - a failed rubber substitute designed for WWII use
the list goes on...