How does squinting alllow one to see clearer pictures? What are the harmful effects?
This is an optical pinhole effect. If the amount of light passed through the lens decreases, the sharper the image is at the focal point. For a camera this is accomplished by increasing the f stop (f22 is a smaller aperture size than f6 — f-stop is an inverse number). For the eye the iris will dilate (get larger) or contract to be smaller. In very bright light, you can cut down on large amounts of light coming in by squinting, which creates a slit in front of the eye lens.
In photography this increases the "depth of field". Which is to say that more objects are in focus and sharp. It works the same for our eyes of course.
In this image you can see as the aperture is smaller, any given point on the focal plane (right hand line) receives light from a smaller angle (i.e. from less of the image field).
I am not a physicist, but that's a first order explanation @Luke reminds me that there was a question about whether squinting is harmful. There is another reason that we squint. If we are nearsighted or if we are getting older, we have a tendency to squint not because there is too much light coming into our eyes, but because our lenses are not focusing very well. Is it harmful to strain our eyes? Maybe, but it won't kill you. Reading glasses won't either.
I have asked various doctors this question over time, as I grew up needing, but never having glasses. Yes, there is a pinhole effect that takes place by reducing the amount of light entering the eye, but that is not the primary mechanism by which squinting helps people who need glasses. The more influential mechanism affects the shape of the eye.
Being near or far-sighted results from a malformed eyeball. If it is elongated either vertically or horizontally, then the ratio between the lens' focusing power and the distance from the lens to the retina is skewed in a detrimental manner. Squinting can help squeeze the eye into a more visually conducive shape, resulting from the stiffened eyelid attempting to close flush to a (normally) spherical surface, forcing the eyeball to move out of the way of the eyelid, and into the shape of a sphere.
This is why squinting can be harmful. You're bending your eyeball.