The pinhole magnifier works on a very simple principle: The closer you get to an object, the bigger it looks to you. This is because the closer you are to the object, the larger the image the object forms on your retina (click to enlarge the diagram below).
Unfortunately, however, there is a limit to this. If you get too close to the object, your eye is not able to bend some of the light rays enough to obtain a focused image. As a result, the image becomes blurry or fuzzy (click to enlarge diagram).
The pinhole magnifier gets around this problem by limiting the rays that come to you from each part of the object (click to enlarge diagram).
Sadly, there is a trade-off between the resolution, or sharpness, of an image and its brightness. A tiny pinhole produces a very sharp image, but, because it cuts down on the number of rays that enter your eye, the pinhole makes the object look much dimmer.