Huge fireworks shows don't just happen. They've gotta be planned. By professional fireworks choreographers, as Slate explains:
Fireworks by Grucci uses special forms that break the display into one-minute intervals. The form specifies exactly which type of shell should be fired at each moment. To time this properly, the choreographer has to know how long it takes for each shell to open up after it's fired. For example, if he wanted two hearts to appear just when Phil Collins mentions hearts, he'd have to mark them on the form about five seconds before the words come in the song.
In general, the bigger the shell, the longer it will take to burst and the higher it will go. By inserting the size, firing time, and type of each shell into a firing script, a choreographer can lay out a series of effects that unfold at different heights in time to the music. If he's using a fireworks choreography software package, he doesn't have to look up (or memorize) all of the height and timing information for each shell. Instead, he can drag items from a digital catalog directly into an online script.