The aperture determines the diameter of the beam of light that the lens admits. Using a wider aperture produces a shallower depth of field; using a narrower aperture gives a greater depth of field. https://www.photographymad.com/pages/view/depth-of-field-explained
My examples using aperture range from large to small: