One of the most important and easiest photography skills to learn is depth of field (DOF). The amount of background and foreground that is in focus relative to the subject is called depth of field.
When only the subject is in focus, we say the photo has a small DOF or shallow focus. When the subject, background and foreground are all in focus, the photo has a large DOF or deep focus. You may or may not know this but the automatic settings on your camera adjusts for depth of field. Have you ever taken a close-up (I mean really close) portrait and have the background blurred out?
There are three main components that control depth of field; aperture, focal length and camera distance from subject.
A lens with large aperture such as f/1.4 will take a shallow-focus photo. A lens with a small aperture such as f/16 will take deeper focus photo than f/1.4.
A short focal length such as 18mm will take a deep-focus picture. A long focal length such as 55mm will take a deeper picture than 18mm.
The closer the camera is to the subject, the shallower the photo will be and vice versa.
A fourth component that controls depth of field is the distance between the subject and the background or foreground, which is trivial. A tree in the background that is 100 metres away from the subject will be more out of focus than a tree that is 5 metres away from the subject.