Until 1967 the second was defined using the motion of the Earth which rotates once on its axis every 24 hours, and there are 3,600 seconds in that hour and 86,400 in 24.
That would be fine if the earth was punctual but in fact it is not. The Earth’s rotation rate changes every day by thousands of nanoseconds, and this is due in a large part to wind and waves spinning around the Earth and causing drag.
Over the course of thousands of days, these changes in the rate of rotation can result in the Earth’s spin getting out of synch with the high-precision atomic clocks that we use to keep the UTC system (Coordinated Universal Time) ticking over. For this reason the Earth’s rotation is monitored and timed using the far off flashes from a type of collapsed star called a quasar that flash with an ultra precise rhythm many millions of light years away. By monitoring the Earth’s spin against these far away objects it can be worked out how much the rotation has slowed.
Other complications arise when it comes to synchronising the Earth to one timescale. In 1905, Albert Einstein’s theory of relativity showed that there is no such thing as absolute time. Every clock, everywhere in the universe, ticks at a different rate. For GPS, this is an enormous issue because it turns out that the clocks on the satellites drift by almost 40,000 nanoseconds per day relative to the clocks on the ground because they are high above the Earth’s surface (and therefore in a weaker gravitational field) and are moving fast relative to the ground.
And as light can travel Forty-thousand feet in that time, you can see the problem. Einstein’s equations first written down in 1905 and 1915 are used to correct for this time-shift, allowing GPS to work, planes to navigate safely and GPS NTP servers to receive the correct time.