The story
From the days of flintlock firearms, where the main charge was intended to be fired by a small charge of gunpowder in the flash pan. If the resultant fire did not pass through the touch hole and ignite the main charge, it produced noise and smoke, but no substantial effect, and was termed a flash in the pan. Sometimes called fluff in the pan, the term refers to any ineffectual, short, spasmodic effort that dies in the attempt, such as an explosion of priming in the lockpan of a gun while the gun itself does not go off.
Etymology from Wiktionary, CC BY-SA 4.0.