Fig. 1.
Light reflected from the retinal plane passes through the pinhole to the detector. Light from any other plane cannot pass through the pinhole and is attenuated. This allows the creation of an optical section.