On a pioneer flintlock rifle the hammer struck a flint to create a spark that ignited a small amount of priming powder in what was called the pan.
This ignition then set off the main charge of gunpowder, causing a small explosion that fired the bullet through the barrel.
When the powder in the pan didn’t ignite properly it created a flash, but the rifle wouldn’t fire.
It looked good, but it was only a “flash in the pan.”
Someone who doesn’t live up to expectations is called a “flash in the pan”.