
The idea emerged from the Lorentz transformations (late 19th century), and in 1905, Albert Einstein derived it from the postulate of the constancy of the speed of light within the framework of special relativity.
Special relativity states that the speed of light is the same for all observers. If a spaceship moves at high speed, its light signals still travel away at 300,000 km/s. To maintain this, from the perspective of an outside observer, time on the ship stretches — each tick of the clock seems longer. Gravitational time dilation: a massive body warps spacetime (the unified arena of three spatial dimensions and time), and clocks near it run slower — as if gravity slows down time itself.