There are three types of digital camera zooms, though the Optical Zoom is the only one that actually extends and retracts the lens mechanism.
Digital and Extended Optical zooms have their place, but not without some compromises.
An optical zoom is a true zoom. As the focal length extends, an image is magnified by the lens itself.
An optical zoom produces the best quality images at all resolutions available on a digital camera. Zoom lenses can magnify an image 3X, 20X, 20X and more. Very long zooms are particularly prone to camera shake. To help prevent this, a gowning number of digital cameras that zoom incorporate Image Stabilization.
Extended optical zoom
An extended optical zoom trims the operational area of the actual camera sensor to increase the maximum magnification. Unlike a digital zoom, an extended optical zoom produces images with little loss of quality.
However, extended optical zooms may only work when a smaller image size is selected than the largest size (resolution) available on a digital camera. Not all digital cameras have extended optical zooms.
A digital zoom is not a true zoom. It is a simulated zoom that enlarges the central portion of an image. The actual length of the lens does not change.
A digital zoom pre-crops the center area of an image. Resolution is reduced, giving the appearance of zooming in. It is similar cropping with photo editing software.
Because of reduced image quality, use a digital zoom only if you have no other options. Most cameras have a setting to turn off the digital zoom. This prevents inadvertent zooming into digital mode.