Depth of field refers to how much is in focus in front of and behind the subject that is focused upon. “More” depth of field means that more is in focus. “Shallow” depth of field means that very little is in focus other than the subject.
The photographer focuses specifically on one object or part of an object. Anything behind or in front of that focusing point will be less in focus. The farther away an object is from that focusing point, the less in focus it will be.
Step 1 is to decide on the main focusing point. Step 2 is to decide how much depth of field is desired to achieve the desired “look” of the photograph. Step 3 is to set the camera's aperture or choose an appropriate lens or focal length.
The human eye cannot determine what is truly sharp, inch by inch, in a scenic landscape. Yet, one inch in a close-up of a flower easily shows which petal is sharp and which is blurry.
One way the photographer controls the amount of depth of field is by changing the camera's aperture setting. A small aperture like f/16 has a larger depth of field than a large aperture like f/3.5. A picture taken with f/16 will have more area in focus in front of and behind the point focused upon. A picture with f/3.5 results in shallow depth of field with one area being obviously the sharpest.
Another way to control the apparent depth of field is with the choice of lens or focal length. A wide angle lens has larger depth of field than a telephoto lens. A landscape taken with a wide angle lens will put more area in focus when used with a small aperture. If the photographer stands on the same spot and uses a telephoto lens, there will be less apparent depth of field in the picture, especially with a large aperture. It is a combination of aperture and lens that affect the depth of field.
In cameras with Portrait Mode the beginning photographer needs to know that the camera is automatically setting a large aperture for shallow depth of field (which will blur the background and foreground). Landscape Mode automatically sets the camera to a small aperture in order to put as much as possible into focus.