When you squint to see clearly, you're creating an artificial pinhole effect by shuttering your pupils. It's kind of like decreasing the F-stop of a camera to increase its depth of focus.