Depth of field is a term used that refers to what part of your image is in focus and what part is out of focus.This is achievable by changing your aperture and the distance from the object you are photographing,both these things change the depth of field.The closer to the object you are photographing the shallower the depth of field and the larger the aperture the shallower the depth of field.
The first image has a large depth of field from front to back this image was taken with an aperture of f32 the second image has a very shallow depth of field and was taken with an aperture of f4