It is said that about 2,000 years ago, during the Song Dynasty, a Chinese cook spilled saltpeter onto a cooking fire and made a really pretty flame. Used since time immemorial as a food preservative and additive, saltpeter (potassium nitrate) was also believed to be an anaphrodisiac that, when ingested, would cause men to become temporally impotent.
The cook told his friends about the pretty flame, experimentation followed, and — BANG! — gunpowder was invented. Then a monk named Li Tian thought of putting the new invention into bamboo shoots and exploding them to scare off evil spirits.