The clocks are naturally radioactive elements, called isotopes, such as uranium.
Radioactive elements change spontaneously to non-radioactive elements. For example, radioactive uranium changes, or decays, to non-radioactive lead. If you start with a certain amount of radioactive uranium (100% U) it takes a certain amount of time for one half of the uranium to become lead (50% U,50% Pb). Then it takes the same amount of time for that half to become one half lead (25% U, 75% Pb), and so on. This is called the half-life, or decay constant; it never changes inside rocks.
Different radioactive elements decay at different rates. Some radioactive isotopes have short half-lives, others have very long half-lives, such as millions or billions of years. This is where you need a fancy machine and laboratory to find out how old Earth is; it is done by actually measuring the very tiny amounts of radioactive elements and their decay products, called the parent and daughter, in rocks.