Aperture / depth of field

Aperture is the adjustable lens opening that controls the amount of light allowed into the camera. Aperture is used whether you want the background or foreground in focus.

What is the difference between the aperture and f-stop - MARAT STEPANOFF  PHOTOGRAPHY

for example if the aperture was f32 the lens would not let a lot of light in because of the small lens this would mean the foreground and background would be in focus, if the aperture was f1.4 the lens would let a lot of light in because of a wider lens this would mean the foreground is in focus but not the background.

Depth of field

Depth of field is the distance between the nearest and furthest elements in a scene.

Miguel Mesquita Photography - Understanding Depth of Field