You may be wondering, what exactly is depth of field (DOF)? Well, DOF is the part of an image that is sharp or in focus. A photo with a blurred background would have a shallow DOF while a picture that is mostly all in focus would have a deep DOF.
There are four factors that effect the depth of field in a photo:
-lens focal length
-distance between the lens and subject
Different apertures create different DOF. Wider apertures, such as f/2.8, would create a shallow depth of field. That means the photo would have the front or subject in focus while the background would be out of focus.
Here's a photo with a very shallow depth of field, at an aperture of f/1.8. The blue flower in front is in focus, while the rest of the photo is out of focus.
And then here I used a small aperture, f/22, which created a very deep DOF. Nearly the whole photo is in focus.
Lens Focal Length
Basically, the longer the focal length, the more shallow depth of field your image will have. Both photos were shot with the exact same setting, the only difference being the focal length.
Lens to Subject Distance
The distance between your lens and your subject also effects the depth of field. The closer you are to your subject, the more shallow DOF you will get.
Both of the photos below were shot at the same aperture, f/3.2. In the first photo I was 1-2 feet from my front subject, while in the second picture I had stepped backwards 4-5 feet.