Frequency is the fundamental difference
Every clock is a frequency counter. Mechanical watches count balance-wheel oscillations: 4 Hz (28,800 vibrations/hour) for most modern Swiss movements, 5 Hz (36,000 vph) for high-beat movements like the Zenith El Primero, 2.5 Hz (18,000 vph) for many vintage. Quartz crystals oscillate at 32,768 Hz (2^15 cycles/second), a fixed frequency chosen so a binary divider can produce a clean 1 Hz output. The higher the regulating frequency, the more precise the time measurement.
Why high frequency = high accuracy
If your regulator drifts slightly (heat, magnetism, age, position), the error per oscillation accumulates linearly. At 4 Hz you have 345,600 oscillations per day to accumulate error across; at 32,768 Hz you have 2.83 billion. A 0.0001% error per oscillation produces ~30 sec/day at mechanical frequency vs ~0.4 sec/day at quartz frequency. The math is fundamental; you can't beat it without changing the technology.
What mechanical watches still drift on
Position: gravity changes balance friction by position; mechanical watches lose 5-15 sec/day swing across positions. Quartz crystals are mostly insensitive. Temperature: hairspring stiffness varies with temperature; quartz crystals also drift but compensation is easier. Magnetism: hairsprings magnetise and lose tension; quartz is largely immune. Lubricant aging: oils dry over years and friction increases; quartz has no oils to dry.
What modern hairsprings change
Modern silicon hairsprings (Patek Spiromax, Rolex Syloxi) and Nivachron alloys are anti-magnetic and temperature-stable, closing some of the quartz-mechanical gap. The best modern mechanicals (Rolex Cal. 32xx, Patek 26-330) hold ±2 sec/day in case at full wind, getting close to thermo-compensated quartz. Pure quartz still wins on accuracy; mechanical wins on character, value retention, and serviceability.