In confocal imaging, lasers are scanned across the sample and at each spot, the fluorescence signal is detected by a photomultiplier and recorded on the computer screen as a pixel in your image. Pixel by pixel, this is how your image is built up. The advantage of using confocal over a widefield microscope is that you can get high resolution images of thicker samples. When imaging a thick sample (greater than ~20microns) with a widefield fluorescence microscope, signal from all planes above and below your desired focal plane is collected and this can result in blurry images. In a confocal, there is a pinhole that lies in front of the detector that blocks out-of-focus light, so that you only get signal from the focal plane of interest.