Let's compare the two pictures above. The left picture has only a limited part in sharp focus, while the right picture is in sharp focus from the foreground to the background. The difference between the two pictures was the aperture setting. The left picture was taken with a large aperture (low f-number), and the right picture was taken with a small aperture (high f-number). Thus, changing the aperture affects the range of acceptable focus (depth of field) in the picture.
Change the aperture and see how the depth of field changes
The narrower the depth of field, the more blurry it gets