In most two state rockets, a booster engine is taped to an upper stage engine. The booster engine has no smoke/delay charge or ejection charge so when the propellant is consumed, the burn blows out the back of the engine, which ignites the second engine and burns through the tape, separating the booster from the upper stage. Note that taping only works for black powder motors.

A booster engine taped to an upper stage engine for a two-stage rocket.

More complicated rockets and rockets that have a composite engine as the upper stage use a timer and an electrical igniter to fire the upper stage.