It's a consequence of the Einstein's theory. That light travels at a constant speed is a basic axiom of relativity. Physicists have since defined measurements in terms of absolute constants, so the meter is defined in terms of the speed of light for example. What it means, in terms of Einstein's theory, is that if light seems to travel at a different speed (through a vacuum), its not that it sped up or slowed down, but rather that space itself warped somehow. So the distance the light is crossing shrank or explanded.

But it also means that if we measure the speed of light, we're actually measuring the length of a meter, not how fast light is moving.