The aperture is the main determinant of depth of field when using a camera. Open the aperture up and you will get less, close it down and you will get more. The question is: Why do you get more depth of field with a small aperture? To simplify things I will only be looking at the object side of the camera for this discussion. The same concepts apply on the object side as they do on the image side, so I will omit the image side for now.
Before we can get going, we need to define the circle of confusion in relation to the object side of the equation. We started by defining the circle of confusion in terms of the image. For a typical Nikon dSLR the circle of confusion is about 0.02 mm and the detector is about 23.6 mm wide. That translates into about 1/1200 of the width of the detector. To translate this to the object side you just need to know the width of your field of view and divide by 1200. This can also be written in terms of magnification as
c(o) = c/m (where c(o) = object side circle of confusion, c = circle of confusion, m = magnification)
As magnification goes down (i.e. The field of view enlarges) the c(o) proportionally enlarges. As the magnification increases the c(o) proportionally decreases.
Now we can get about discussing the role of the aperture in DOF. The top part of the diagram shows a large aperture with a relatively narrow depth of field. The object circle of confusion is located at the focus plane and listed as c(o) The bottom diagram shows the effect of closing the aperture. The c(o) remains the same, but the angle of the rays extending from the lens to c(o) has decreased and this causes the depth of field to increase. At a narrow angle, it takes longer for the blur circle to enlarge to the size of the c(o) and thus the DOF is increased.
You will also notice that the increase is mostly on the far side of the focus plane. Because of the angles involved, there will always be more depth of field on the far side of the focus plane compared to the near side. As the field of view gets larger (lower magnification), that difference will increase. Typical photographers say that 1/3 of the DOF is in front of the focus plane and 2/3 is behind the focus plane. This is more of a rule of thumb than a fact as the actual distribution varies quite widely.As the magnification rises into the macro photography range, the distribution of DOF becomes more equal on the far and near side of the focus plane. The distribution always favors the far side, but the difference becomes minimal at high magnification. Because of this it is commonly assumed the distribution is equal far to near with macro photography. Next: Why is there so little DOF at high magnification?