Depth of field is an important part of your image composition, as sometimes you may want a lot of your image in focus, while other times only requiring a very small amount of the image to be sharp. For example, usually you would want most, if not all, of your image sharply focused in a landscape photograph, while a portrait looks best if you can blur out the background.
DoF is dependent on a couple of main things, being the size of film or image sensor you are using, and the aperture setting of the lens. It is the combination of these elements that decides how gradually the image becomes defocused at distances moving away from the focal point. Generally, you are in a position to control only the aperture setting, and rather than for simply making exposure adjustments, this is where creative use of the aperture setting on your camera can help you create better pictures.
Getting into the technical details, what actually decides how much of your image is in focus is something called the “Circle of Confusion”. And despite the name, it’s not all that confusing. Once you have a basic understanding of the concept of it, your understanding of how to achieve the correct DoF will be much better.
A camera lens basically works by taking the incoming light (the scene you are pointing it at) and bending it to eventually focus it down to a point on your camera’s sensor or film. The area at which these light rays are focussed perfectly is where they cross over to become a point, and the areas before and after the rays come to a perfect point are where the image starts to become out of focus. In the image below
Therefore, the Depth of Field is the region where the Circle of Confusion is less than the resolution of the human eye. Generally speaking, this is said to be a part of the image that appears in focus when viewing an 8”x10” enlargement from about 30cm away.
The size of the circle of confusion is dependent upon the size of the image sensor, and its resolution. The aperture of the lens decides the distance between the focal plane and the closest and furthest distances of acceptable sharpness. The rays of light from the edges of the aperture travel much more steeply down towards the film plane when its iris is larger compared to when it is smaller. Therefore creating a larger depth of field. See the picture below.