The purpose of gunpowder is to burn rapidly. Burning generates a lot of hot gas that tries to expand. The bomb's physical shell, along with the inertia of the stars, resists the expansion for a brief moment, creating pressure that's used to propel the stars away at high speeds, but also ensures that the burning gunpowder charge has time to ignite the stars before they fly away.