The Lunar Orbiter Laser Altimeter (LOLA) works by propagating a single laser pulse through a Diffractive Optical Element that splits it into five beams. These beams then strike and are backscattered from the lunar surface. From the return pulse, the LOLA electronics determine the time of flight which, accounting for the speed of light, provides a precise measurement of the range from the spacecraft to the lunar surface. These range measurements, combined with accurate tracking of the spacecraft's location, are used to build a map revealing the contours of the lunar landscape.

Source: NASA