For the same reason a pinhole camera works.
The light entering your eye all traverses a small hole – your pupil – that gets even smaller when your pupil constricts. It then diverges in a cone and hits the retina on the back of your eye, forming an image. (The image is inverted, by the way.) The size of the pupil controls the brightness of the image on your retina, not how big the image is on your retina.
Latest Answers