Flexi Says: All fireworks work the same basic way. A fuse ignites gunpowder, which explodes. Fireworks also contain small amounts of alkaline Earth metals, such as magnesium, calcium, barium, or strontium. These metals get really hot when the fireworks explode and glow in brilliant colors. The metals are the secret to the breathtaking beauty of fireworks.