Depth of Field refers to the area of focus in your scene, from the point of sharpest focus, to the most out of focus parts, in front of and behind the point of focus. This is one aspect of photography where the differences between SLRs and compact cameras are the most pronounced. There are several variables that affect depth of field, but the first one is built into your camera to begin with; the size of your sensor. DSLRs sensors are either the same size as a 35mm frame (only a few very high end DLSR have these) or APC sized sensors (which are about 2/3rds the size of a 35mm frame). Their physical size dramatically dwarfs the tiny image sensors built into most compact cameras (and now cell phones) and this affects the depth of field they are capable of producing in an image. Simply put, compact cameras are limited to large depths of field, due to their tiny sensors, even if their lenses have apertures. DSLRs, on the other hand, have a much greater range of DOF (depth of field), particularly if the lens used has a wide aperture to start with. The DOF range of cameras further increase in medium format cameras, and then on to large format cameras. DSLRs (as well as SLRs from the film days) are popular with amateurs and professionals alike because they combine some of the portability of compact cameras with some of the DOF capabilities of medium and large format cameras, placing them as one of the most versatile class of cameras. Aside from the format size of your camera, there are three more important variables that determine DOF.
Aperture affects Depth of Field
The illustration above shows a camera with a 50mm lens shooting at f/2.8 and f/16. The wider aperture of f/2.8 lets in more light, but also narrows the DOF so that only the flower in focus will look sharp. Conversely, the narrow aperture of f/16 widens the DOF, showing many more flowers in front of and behind the point of focus as relatively sharp. I shot a series of photos of a ladder on an old fire truck to further illustrate the difference.
Adjusting your aperture is the most cited method of controlling depth of field, and I'll go a little more into this at the end of this post, but there are two more factors that often go overlooked.
Subject distance affects Depth of Field
Above, the camera has a 50mm lens and is set at f/8 for both shots. The difference is that first shot is focused on a flower further away, and the second shot is focused on a flower that is very close to the camera. In spite of having identical apertures and focal lengths, the DOF for the flowers in the first shot is much wider than the closer flower in the second shot. The nearer the subject in focus is to the camera, the narrower the depth of field will be, independent of the aperture setting.
Focal Length affects Depth of Field
Above, the camera is set at f/8, and is focused on the same flower for both shots, but the focal length of the lens is different for each shot. In the first shot, a wide angle 24mm lens is used, which will also yield a wider DOF. This property is one of the reasons wide angle lenses are frequently used in landscape photography, where keeping the entire scene in focus is often desired. The second shot uses a more telephoto 105mm lens, with a narrower angle of view, which also yields a narrower DOF. This is one quality of telephoto lenses that make them popular in portraiture, where separating the subject from the background can help the composition. Below are two photos I shot to illustrate how focal length affects DOF. Notice how the fence in the background is less in focus once I zoom in to 75mm.
Baby stepping...Aperture Priority Mode
At this point, I would invite the beginning photographer to take a baby step into the art and craft of photography by switching your camera from "Auto" mode to "Aperture Priority Mode". In this mode, the camera will still make most of the decisions for determining exposure, but you are taking control of one variable - the aperture. Once you set the aperture, the camera will adust the shutter speed and the ISO (most DSLRs are "auto ISO" by default, so that it can adjust it as needed) around your aperture setting as it's metering the scene. As you go along, you will be incorporating DOF as an element of composition in the shots you take. Try using a wide open aperture when shooting portraits, and notice how shallow DOF will blur what might otherwise be a busy, distracting background. Set a small aperture of f/16 or f/22 when shooting landscape. Of course, everything in the previous lessons about exposure and camera shake still apply, even if the camera is handling most of the exposure settings for you, so be careful in low light situations.