system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How are fireworks made to explode in complicated shapes and patterns?
gpt
The payloads for "sky" fireworks (not the part that delivers them to the sky where they explode) are made up of a number of different parts. A quick summary for some of the main ones:

- Fuses - do not explode, but burn at a set pace. When a part of a firework is not yet visible, it's burning a fuse (or other time-delay part) so the visible components will be delayed..

- Explosives -A small charge that blasts other parts of the firework in different directions and in different patterns. Other parts of fireworks are packed around the explosive so when it detonates, it forces the other parts out in various patterns. If you pack everything around the explosive in a single circle, you get a flat disk firework display. If you pack everything around it in a sphere, you get a round firework display. 

- Black powder - the bang, or "report". Not visible, just loud when it goes off. Other powders can produce smoke, which is important to daytime fireworks.

- Stars (or other visible elements) - Often pellets, these burn brightly once ignited. Also can include 'sprays' that fountains make.

- Propellant - Sometimes parts of fireworks have extra little 'rockets' on them that create thrust so they zip off in different (and sometimes crazy) directions.

- Cardboard/paper - makes containers to hold the parts together while keeping the pieces separated. There can be a lot of it in larger, more complex fireworks.

- Chemicals - different salts and other chemicals burn with different colours. A star with copper salts added will burn green, just like some of those crazy salts you can buy to turn your campfire different colours.

So a standard "Peony" firework (very common in commercial displays) is a sphere of short-duration Stars with an Explosive in the middle which blasts the stars out in a sphere pattern as they ignite and burn. A very large one can actually force smaller explosives-surrounded-by-stars out - the first explosion sets off the fuse for the second explosion as it flies away so it'll detonate a bit later.

Finally the colours are created by different chemicals added to the stars. Take a long star, add one chemical to one end and a different one to the other, and it'll change colour as it burns.