The aperture influences how much light falls on the sensor. If the aperture opening is very small, i.e. the aperture is closed, very little light falls on the sensor. On the contrary, if the aperture is very wide open, more light falls on the sensor. So the image is differently bright depending on the aperture.
If the aperture is closed, the image is dark; if the aperture is wide open, the image is bright.
Of course, this only applies as long as the other settings remain the same.
The aperture not only affects the brightness of the image but also the depth of field. Depth of field is a phenomenon that you can observe yourself. Hold your left hand about 30 cm in front of your face. Now close one eye and look at your left hand. You will notice that whatever is behind your hand becomes blurry. If you now take your right hand and hold it in front of your left hand, the closer you get to the eye, the blurrier the right hand becomes.
The same happens with a camera. If you focus the camera on an object, all objects at the same distance from the camera will appear in focus. This distance is called the focal plane. The further away an object is from the focal plane, the more blurred the object appears.
Actually, however, the focus plane is a cuboid. So there is a certain range in which all objects are sharp. The depth of field indicates the size of this area. If the depth of field is small, this range is very small. With a large depth of field, the focus 'plane' or focus box is very deep.
How blurred an object is depends not only on the distance from the object to the focal plane, but also on the aperture. In general, the wider the aperture is opened, the more blurred the objects in front of and behind the focal plane become.
Furthermore, the blur is also dependent on the distance from the focal plane to the camera and the focal length. The following applies here:
The closer the focus plane to the camera and the longer the focal length, the blurrier the objects in front of and behind the focus plane become.