Definition
Optical zoom moves the lens physically to magnify a subject without losing any pixels. Digital zoom is a software method that crops out part of the image the sensor captured and stretches it to fill the screen.
Optical zoom: moving the lens itself
You've probably turned the zoom lever on a pair of binoculars to look at a faraway view more closely. The lenses inside shift their distance from each other, and the distant object leaps right up to your eyes.
A camera's optical zoom works on the very same principle. Inside the camera lens are several pieces of glass, and a motor slides them forward and back. When the distance between the lenses changes, the angle at which light bends changes too. That makes the image landing on the image sensor (the semiconductor plate that detects light and builds the photo) bigger in its own right.
No pixels are lost in this process, unlike with digital zoom. The tens of millions of pixels on the sensor take in the enlarged image in full. That's why a photo taken with optical zoom can keep its sharp image quality.
Digital zoom: cropping and stretching the photo
Everyone has opened a photo in a phone's gallery and spread two fingers across the screen to enlarge it. You can see one part up close, but stretch it just a little too far and the letters smear, with square dots shimmering across the image.
Digital zoom works exactly like that screen enlargement. The lens stays put. From the whole picture the camera sensor took in, the camera cuts out just a piece from the middle, as if with a knife. Then it forcibly stretches that small piece to fit the original screen size.
Where there was no information to begin with, the phone's software fills in the empty space roughly, imitating the surrounding colors. So the higher the magnification with digital zoom, the more the photo blurs and the pixels break up. That said, at low magnification, where the camera crops the center of a sensor with a very large number of pixels, the loss in quality tends to be small.
To be more precise: the secret of smartphone cameras
A smartphone camera works a little differently from a standard camera. A phone is thinner than one centimeter, and fitting a thick telephoto lens stack inside it and sliding it back and forth is physically very hard.
So most phone makers put several cameras with different fixed lenses on the back, such as a 1x standard lens, a 3x telephoto lens, and a 5x telephoto lens. When you tap the 3x zoom button on the screen, no lens moves. The phone instantly switches to the 3x camera.
These days, folded zoom technology is widely used. Like a periscope, it uses a mirror to bend light at a right angle, so the lens can lie sideways inside the phone's body. Add hybrid techniques, such as combining several shots and smoothing edges with artificial intelligence, and phones now cut image-quality loss by a lot.
Common misconceptions
The '100x zoom' in smartphone ads means objects 100 times farther away come out sharp.
A phone's 100x zoom is the result of roughly 5x or 10x optical zoom, plus 10 to 20 times of digital enlargement and AI correction on top. In the stretch that isn't optical, a loss of quality and artificial-looking distortion are unavoidable.
Where you meet it
At a concert, you pull the singer on stage in close with a 3x optical telephoto camera and capture their expression and even the folds of their clothes sharply.
To read the writing on a chalkboard, you stretch your phone screen with 10x digital zoom, and the edges of the letters shimmer and break up like a mosaic.
In one sentence
Optical zoom moves the lens to magnify a subject without losing pixels, while digital zoom crops part of the captured photo and forcibly stretches it.