For most of history, a second was simply a fraction of a day. But a day is set by Earth's rotation, which wobbles and slowly drifts, so a second tied to it was never quite constant.
Atoms make better pendulums. Every caesium-133 atom has the same 'hyperfine' transition, and the International System of Units defines the second by fixing that transition's frequency at exactly 9 192 631 770 hertz.
Other units now hang from the second. The metre is defined by fixing the speed of light in vacuum at exactly 299 792 458 metres per second — so measuring length now depends on measuring time.
