Depth of Field

Depth of field is a phenomena that causes certain parts of an image to blur based on its distance from the camera. It is exploited as a photographic technique for a variety of reasons. A shallow depth of field can be used to accentuate certain parts of a scene, give more detailed information about a subject by exposing just a portion of it, or to remove a distracting background. A wide depth of field puts all elements in focus.
An image is always sharpest at the cameras focal distance, but the depth of field is controlled by the camera's aperture, measured in f-stop. The smaller the f-stop number, the smaller the depth of field; the larger the f-stop, the larger the depth of field.

Wide depth of field, f/22

Shallow depth of field, f/2