How can they show us the passage of time? And how is it so exact?
It depends on the clock. But all of them rely on some repeating process that takes a known amount of time.
In a pendulum clock, the time it takes for the pendulum to swing is known. Under some simplifying assumptions, the time for a pendulum to swing is dependent only on its length, so there’s a specific length that corresponds to a swing time of 1 second. You hook that pendulum up to a gear, then set that gear up with other gears attached to the hour, minute, and (if desired) second hands with the appropriate ratios.
Electronic timekeeping involves special circuits that produce a periodic signal called, appropriately enough, a [clock signal](https://en.wikipedia.org/wiki/Clock_signal).
The most accurate clocks are atomic clocks, which work by measuring specific vibrations in specific types of atom. Specifically, they work by finding a resonant frequency in specific atoms and tuning light of exactly that frequency. Since the frequency and energy of light have a nice relationship, and since you can precisely measure how much energy you’re putting in to a signal, you can measure time extremely accurately (with an error of about 1 part in a billion trillion) this way.
It’s actually very simple, clocks are devices that consume some form of energy. For example, the energy in a coiled spring (for wristwatches) or a huge weight attached to a chain ([grandfather clocks](https://i.ebayimg.com/images/g/–oAAOSwm3hisKKs/s-l1600.jpg) for example).
So normally a spring would unwind, or a weight would move downwards, at the maximum speed that the mechanism allows for. So for a clock, the trick is to have a [limiter mechanism](https://upload.wikimedia.org/wikipedia/commons/2/29/Anchor_escapement_animation_217x328px.gif) in the clock to control how fast the energy is consumed, how fast the spring uncoils, how fast the weights are allowed to move downwards.
And it’s just a matter of getting that limiter mechanism “tuned” to an exact second. Either by precision manufacturing, or by using something that only oscillates at a certain frequency (number of beats per second). One such device is a [pendulum](https://www.sciencefacts.net/wp-content/uploads/2020/07/Simple-Pendulum.jpg), a pendulum’s back and forth motion depends very precisely on its length / dimensions. Another such device is a spring with a flywheel, the inertia of the flywheel depends very precisely on its dimensions and weight, so it will oscillate at precise intervals.
Clocks take advantage of one of two phenomena, depending on the type of clock.
1) Pendulums. The time it takes a pendulum to swing back and forth is a function of the length of the pendulum, and gravity. It doesn’t matter if the pendulum is making wide fast swings, or short slow swings, it still takes the same pendulum the same amount of time to swing back and forth. So in something like a grandfather clock, you design the pendulum so that its swing lasts one second, you use some machinery to make the pendulum swing fairly low friction (so that it will swing for a long time without needing to be reset,) and that’s your mechanism for keeping time.
2) Crystals. If you apply a small amount of electricity to a quartz crystal, it vibrates. And the vibration is at an extremely precise frequency. So any electric clock, be it in your watch or your phone or whatever, uses a tiny battery and a quartz crystal as its mechanism for keeping time.