system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do you make fire works have shapes, such as hearts and shapes.
gpt
Even though the cartridges you see probably all look ball shaped, what's inside isn't.
 If you take a fire cracker, and put it in a metal bowl, the explosion will be contained on the sides, and be pushed out the top of the bowl.
This shape charge effect is what all sorts of explosives use, and the same is with fireworks.

If you have 2 explosives in close proximity to eachother, they will act on eachother to change the shape. Try taking a pool of water, and putting your fingers in 2 different places at the same time, see how the ripples interact with eachother. This interaction also happens in fireworks.

Also timing helps. Try putting your finger in water, then a second later, put your finger in another part of the water. The stronger ripples will have a bigger effect than the smaller ripples, but the smaller ripples will still have some effect.

The fireworks manufacturer has spent a lot of time and money researching the correct way to pack the charge so that it comes out the way they want. Hope this helps, and hope you enjoyed your fourth.