What does each component of modern fireworks do?

The modern components of fireworks is a complex system of patterns within the fireworks. These patterns are formed with small tubes of gunpowder.