Einstein's Special Relativity states that the laws of physics are the same in all inertial frames, specifically the same on a steadily moving train as they are on the ground. But the laws predict that the speed of light, called c, has a precise value, close to three hundred thousand kilometers per second. This means two different observers, looking at the same moving blob of light, will say that's how fast it's moving relative to them, even though they are moving relative to each other!
A major consequence of this apparent paradox is that time flows at different rates in the two frames: a moving clock is observed to run slow. Here's a primitive clock: a blob of light bouncing back and forth between two fixed mirrors. If the clock is moving relative to us, the light must go further on a zigzag path—but its speed must be the same, so it takes longer, and the clock runs slow.
It's all fully explained in this lecture!
The reality of this effect is well illustrated by the GPS, which depends on very accurate clocks in moving satellites. The system yields seriously incorrect results if the relativistic clock slowing is ignored. There is in addition a general relativistic effect of comparable magnitude, discussed here.