“Each ray of light moves in the coordinate system ‘at rest’ with the definite, constant velocity V independent of whether this ray of light is emitted by a body at rest or a body in motion.” -Albert Einstein, 1905
The idea of relativity, that there’s no “absolute rest frame” where the laws of physics are special, has been around since Galileo. If you think about a moving train firing a cannonball, that’s Galilean relativity: a person on the train would see the cannonball move at a different speed from a person on the ground.
But if you replace that cannonball with light, things aren’t so simple. All of a sudden, no matter how fast the train moves or how fast someone on the ground moves, light appears to move at the same speed: the speed of light in a vacuum. Suddenly, Galilean relativity was no longer sufficient, and it took Einstein to put together exactly how it all works.
Light emitted from a train will appear to move at the same speed to all observers, whether on or off the train or any other moving body. Image credit: Wikimedia Commons user Downtowngal, under a c.c.a.-s.a.-3.0 license.