After ignition, the flame front needs time to develop and propagate in order to create the pressure to push the piston down. The time this takes is accounted for by how much spark advance is needed (expressed in degrees BTDC) so the 'explosion' occurs as the piston turns around and heads down the cylinder. As mentioned above, the engine parameters determine the optimum advance, and as the motor spins faster more advance is needed. Thats why there is an RPM dependent mechanical/vacuum advance as well.