The term “a flash in the pan” is used to refer to something or someone that failed, despite having great potential. Once might say, for example, that a product with great promise was a flash in the pan if it didn't do well on the open market. Obviously, one wants to avoid this, since it is generally unproductive.
Like many colorful phrases, this term does have roots in reality, although there is some dispute over its origins. As often happens with well known slang terms, some people have invented folk origins in an attempt to explain it. Many people think that the term dates from around the 1840s, when in fact people have been discussing the term since at least the 1600s, when it was used in a reference to relatively new and sometimes accident prone technology.
The term appears to date to the mid 1600s, and it is a reference to early firearms. Originally, in order to get a musket to fire, a charging pan loaded with gunpowder was used. When the gunpowder in the pan ignited, it was supposed to spread to the actual charge in the musket, causing it to fire. If the charge didn't ignite, a flash resulted, but there was no corresponding bang. The concept was well known enough by the late 1600s for it to be used in a play.
Some people mistakenly believe that the term relates to 19th century mining in California. The idea is that miners would have caught a brief glimpse of flashing gold in their pans while they worked, causing them to get excited about the potential for wealth and escape from the gold fields. When the flash in the pan turned out to be an illusion, one might say that it “didn't pan out,” meaning that it resolved into nothing.
The term implies that, in order to avoid a flash in the pan, careful planning and arrangement are required. Even when people take the time to avert the issue, however, sometimes the charge simply fails to fire, illustrating the role that chance can play in one's life, despite efforts to fight it. The term is related, incidentally, to “lock, stock, and barrel,” which refers to all the parts of a flintlock musket, meaning “the whole thing.”