PINHOLE MAGNIFIER shows how pinholes seem to work like lenses.
The human eye can only focus on things when they are far enough
away; when objects are closer than this minimum distance, the
lens can't bend all the light to the same place on the retina,
so it can't focus the image. A pinhole doesn't bend light, it
simply limits the light entering the eye to those rays which go
straight through the pinhole. As long as the pinhole is small,
the pinhole image remains sharp no matter how close the eye gets.
Because the pinhole lets the eye get closer than normal to something,
it also seems to act as a magnifier.