How does squinting improve vision?

Under normal conditions, light comes into the eye in all directions. Rays coming in at an angle above or below the horizontal will naturally focus in front of or behind the center of vision. Rays coming in more directly would tend to focus more directly on the retina. By squinting, you create a smaller opening for incoming light – similar to how the aperture on a camera works. The narrower you can make this “aperture,” the more likely the light rays coming in will be closer to the horizontal and therefore more in focus. Of course there’s the trade off that if you squint too tightly you won’t be letting enough light in to see anything at all.

Source: The New York Times Book of Science Questions and Answers.