Hydrogen peroxide (H2O2) is always decomposing to release oxygen and water, but it does so slowly. In elephant toothpaste, the hydrogen peroxide is mixed with detergent and food color and then saturated iodide solution is added. The iodide acts as a catalyst so that the H2O2 breaks down really quickly. All the gas bubbles released makes the detergent bubble up suddenly.