How does a fingerprint sensor work?
By building an image of the ridges and valleys of your fingertip, then comparing extracted features rather than the picture — and the three sensing technologies have meaningfully different strengths.
Capacitive, the most common in dedicated sensors. An array of tiny capacitors measures distance to the skin: ridges touching the surface read differently from valleys holding air. Fast, reasonably secure, and defeated by wet or very dry fingers, which is the everyday failure mode.
Optical, used in most under-display phone sensors. The screen illuminates the finger and a camera beneath photographs the reflection. It works through glass, which is why it enabled in-display sensing — and being image-based it is more vulnerable to high-quality spoofs than the alternatives, which is why liveness detection is layered on top.
Ultrasonic, the most capable. It emits high-frequency sound and times the echoes, building a three-dimensional map of the ridge structure and some sub-surface detail. It works with wet or greasy fingers and is considerably harder to spoof, at higher cost.
What is actually stored, which matters for privacy. Not an image of your fingerprint. The system extracts minutiae — ridge endings, bifurcations and their relative positions — and derives a mathematical template. The original cannot practically be reconstructed from it, and on modern phones the template never leaves a dedicated secure enclave on the chip and is never sent to the manufacturer or to apps. An app is told yes or no, nothing more.
Why it sometimes fails: moisture, dryness, cuts, cold fingers, screen protectors over optical sensors, and the fact that a template degrades in usefulness if enrolled poorly — enrolling the same finger twice, at different angles, measurably improves reliability.
Security in context. A fingerprint is convenient rather than maximally secure: it is left on everything you touch, it cannot be changed if compromised, and legal protections for biometrics differ from those for passcodes in some jurisdictions. The passcode remains the stronger credential, which is why devices demand it after a restart.