When we adjust our camera's lens to focus on a subject it will only achieve perfect focus at one particular distance; anything in front or behind this point will be blurred to a greater or lesser degree. Depth of field is affected by three main factors: Lens aperture diameter, Focal length and Distance from the subject. The aperture determines the diameter of the beam of light that the lens admits. The wider the aperture, the wider the beam of light. A wider beam is more susceptible to depth of field effects than a narrower beam. Focal length is a measure of how much the lens magnifies a scene. The lens also magnifies differences in focus. A longer focal length magnifies focus differences, resulting in a shallower depth of field.
below are some examples of photos where the depth of field gets gradually shallower:
deep depth of field
shallow depth of field
best photo
This is the best photo because the aperture has been set so that only the car is in focus with everything else very blurred, an extremely shallow depth of field. The exposure has been set so that the photo is slightly bleached out, which is the effect that I have tried to create. Finally, the angle is not boring and I have used the rule of thirds, resulting in a balanced composition.
worst photo
This is my worst photo as the aperture has been set so that everything in the shot is in focus, which is not the style i was going for.