It is EXACTLY like camera lenses.
The human eye is around a 20mm to 25mm focal length lens (the distance from your cornea to the retina). Call it 1 inch, 25.4mm to make the math easy.
On a bright day, your pupil can constrict to around 1/8" diameter. The f-ratio of a lens is the focal length divided by the aperture diameter, so on a bright day your eye is an f:8 lens. In dim light, the pupil can dilate to about 3/8", so at wide open pupil, your eye is an f:2.8 lens with considerably shorter depth of field. Here is an example of how identical focus can achieve a large or a small depth of field, depending on aperture size:
When you use a rear aperture that is 1.1mm in diameter, your eye becomes an f:22 lens (25/1.1), with greater depth of field than the naked eye ever had, even in bright light.
If you go into the depth of field math, you will see that the actual depth of field for a lens is a function of the f ratio, but also of focal distance. If you are focusing up close, even an f:22 lens will have a near distance and a far distance which are out of focus.
If you look at old camera lenses, you can see the middle row of numbers would actually tell you what the depth of field was for that focus and aperture setting. On this lens, which is focused at 4 ft, and using an aperture of f16, the depth of field of the lens would be from infinity (where the '16' indicator lines up on the right with the focus infinity symbol), all the way back to 2 feet, (where the '16' lines up between 1.75 and 2.5 on the focal ring).
If this same lens, focused at the same point, were using an f8 setting, the depth of field would only be from a little over 7 feet, back to about 3 feet.
For any given f-ratio in a lens, the greatest possible depth of field you can achieve is if you set the distant f marker at infinity, setting your depth of field from infinity back to some near distance. The focal distance, ie the distance at which the center marker lines up in this condition, is referred to as the hyperfocal distance for that lens, and at that condition, the near depth of field distance will always be exactly 1/2 the distance of the hyperfocal. This is why, with the f16 distance marker lined up to infinity, the near distance is 2 ft when the focus is at 4 ft.
So, circling back to your question: a small rear aperture gives you a higher f-ratio in your eye, improving depth of field. By setting the focus of your eye between the target and the front sight, this improves focus on both the target and the front sight at the same time.
Adding my build on your question, your greatest depth of field will be achieved if you focus at exactly 2x the distance from your eye to the front sight. I won't make my answer even longer by going into lens math and how to calculate diopter strengths, but the bottom line is that for a rifle, the lens that accomplishes this is +0.5 diopters over your distance vision correction. There are two ways to accomplish this: first is to flex the ciliary muscle in your eye, which will deform the lens in your eye to move your focal point closer. This is easier for younger eyes, but it does still have the disadvantage that getting your eyes to a consistent focal point is difficult. The second way is to leave the eye muscle relaxed and add a +0.50 diopter lens into the equation.
In the interests of transparency, I do sell lenses to shooters, so there is a degree of self-interest, though I'd also point out that as a professional in the field, and a High Power Service Rifle shooter, and an amateur photographer, I have a better understanding of optical physics and the needs of shooters than your average bear.