Quartz clock operation is based on the piezoelectric property of quartz crystals.
If you apply an electric field to the crystal, it changes its shape, and if you squeeze it or bend it, it generates an electric field.
When put in a suitable electronic circuit, this interaction between mechanical stress and electric field causes the crystal to vibrate and generate an electric signal of relatively constant frequency that can be used to operate an electronic clock display.
Quartz crystal clocks were better because they had no gears or escapements to disturb their regular frequency.
Even so, they still relied on a mechanical vibration whose frequency depended critically on the crystal's size, shape and temperature.
Thus, no two crystals can be exactly alike, with just the same frequency.
Such quartz clocks and watches continue to dominate the market in numbers because their performance is excellent for their price. But the timekeeping performance of quartz clocks has been substantially surpassed by atomic clocks.