Passive autofocus, commonly found on single-lens reflex (SLR) autofocus cameras, determines the distance to the subject by computer analysis of the image itself. The camera actually looks at the scene and drives the lens back and forth searching for the best focus.
A typical autofocus sensor is a charge-coupled device (CCD) that provides input to algorithms that compute the contrast of the actual picture elements. The CCD is typically a single strip of 100 or 200 pixels. Light from the scene hits this strip and the microprocessor looks at the values from each pixel. The following images help you understand what the camera sees:
The microprocessor in the camera looks at the strip of pixels and looks at the difference in intensity among the adjacent pixels. If the scene is out of focus, adjacent pixels have very similar intensities. The microprocessor moves the lens, looks at the CCD's pixels again and sees if the difference in intensity between adjacent pixels improved or got worse. The microprocessor then searches for the point where there is maximum intensity difference between adjacent pixels -- that's the point of best focus. Look at the difference in the pixels in the two red boxes above: In the upper box, the difference in intensity between adjacent pixels is very slight, while in the bottom box it is much greater. That is what the microprocessor is looking for as it drives the lens back and forth.
Passive autofocus must have light and image contrast in order to do its job. The image needs to have some detail in it that provides contrast. If you try to take a picture of a blank wall or a large object of uniform color, the camera cannot compare adjacent pixels so it cannot focus.
There is no distance-to-subject limitation with passive autofocus like there is with the infrared beam of an active autofocus system. Passive autofocus also works fine through a window, since the system "sees" the subject through the window just like you do.
Passive autofocus systems usually react to vertical detail. When you hold the camera in the horizontal position, the passive autofocus system will have a hard time with a boat on the horizon but no problem with a flagpole or any other vertical detail. If you are holding the camera in the usual horizontal mode, focus on the vertical edge of the face. If you are holding the camera in the vertical mode, focus on a horizontal detail.
Newer, more expensive camera designs have combinations of vertical and horizontal sensors to solve this problem. But it's still the camera user's job to keep the camera's sensors from being confused on objects of uniform color.
You can see how much area your camera's autofocus sensors cover by looking through the viewfinder at a small picture or a light switch on a blank wall. Move the camera from left to right and see at which point the autofocus system becomes confused.