Pancake lenses are primarily valued for providing quality optics in a compact package. The resulting camera and lens assembly may even be small enough to be pocketable, a design feature which is usually impractical with conventional SLR bodies and lens assemblies. Pancake lenses can be very short and flat because they do not need large amounts of optical correction, i.e. extra lens elements. The problem arises when such lenses have too short a focal length to fit in front of the retractable mirrors used in reflex cameras. In such a situation a pancake lens focuses in front of, rather than on, the focal plane (film or light sensor) of the camera. This has necessitated the design of retrofocus lenses that refocus the image further back, which is why such lenses are longer and bulkier than their "pancake" equivalents.
An early example is the (Zeiss) Tessar of 1902.
Canon EF 40mm f/2.8 STM pancake lens