The origin of the Stokes shift