First, let me explain the term "space" as used here. Space is really an empty void, a vacuum, nothing. So what is meant by "space" here is the "metric" of space, which can be visualized as 3-dimentional grid lines overlaying space. This is what can change, not real space. Secondly, the speed of light is CONSTANT (always the same) in a vacuum (space). Speed is distance / time (in this context, distance is measured on the grid lines).
Einstein's Special Theory of Relativity shows that the faster a spaceship goes, the slower its clock ticks and the shorter its length in the direction of travel. This results from the CONSTANT speed of light REGARDLESS of the speed of the object that the light comes from or is going to.
Imagine you're at the front wall of a room in a spaceship travelling at almost the speed of light. If a light from the back wall of that room sends a beam of light forward, and you're moving away from it at almost the speed of light, you might think that it would take a long time to reach you, but you'd be wrong because the speed of light in a vacuum is a CONSTANT, REGARDLESS of the speed of the object that the light comes from or is going to. The light would reach you as if the spaceship were stopped because time and the "metric" of space have to change in the spaceship so that light would still get to you at its CONSTANT speed (VERY fast). If Einstein had it wrong, then light could travel almost twice as fast or almost not at all, and it can't.
After he published that theory in 1905, Einstein began thinking about formulating the acceleration of the spaceship. He then had the famous "Equivalancy Thought" that equated the acceleration of a spaceship to the acceleration of mass that gravity caused. Of course they were exactly the same. If he could write a mathematical formula for the acceleration of the spaceship, it could also include the acceleration of gravity, which made it a VERY good goal. But it wasn't until 1915 that he was able to publish the General Theory of Relativity with a mathematical formula that equated mass-energy with space-time. Finally a formula could explain how local space and time changed when a spaceship accelerated. And gravity was explained as a change in space and time. Notice how the speed of light equates both mass and energy AND space and time.