The signature bang from a firework comes in much the same way as a typical action film explosion does; lighting gun powder, whose main constituent is potassium nitrate. That is the same potassium nitrate that Guy Fawkes used to try and blow up Parliament.
During the explosions, metals contained in the firework, such as magnesium and aluminum, are rapidly heated causing them to glow which gives us many of the oranges, whites and reds we see. This is called incandescence. But what of the blues, golds and greens? These are caused by luminescence; this is where salts emit photons (particles of light) as their electrons drop from a high energy to a low energy. Each salt has characteristic energies so emit photons of differing energies, each photon of differing energy is seen by the eye as a different colour. Reds can come from strontium salts, greens from barium salts and any other colour you can think of can be made. This can be tried out simply at home: just burn some table salt, sodium chloride, and see what colour you get!