File this under how stuff works for stereograms (aka Magic Eye pictures)
At a glance, the Magic Eye pictures (stereograms, like this one, which is in the portfolio of a designer whose Web site you can reach by clicking on the image) you see sometimes at stores in the mall, or in books or even postcards, look like a colorful abstract pattern or a collage of little pictures. But if you can learn to focus on a spot some distance behind the surface of the picture, you can get a 3-D image to show up. This all boils down to building into the image cues that let you perceive the 2-D image as having depth.
We have several mechanisms for perceiving depth. Some rely on having two eyes and others rely on just one. But although I have no problem resolving stereograms, I can't do it with only one eye, so that narrows the choices of explanations down considerably. I also observe that the pictures are harder to resolve if they are turned on their sides or upside down, which leads me to believe that what's really at work is that the artists have created images for the right and left eye that differ just enough to create the 3-D effect.
In Steven Pinker's "How the Mind Works," a couple of illustrations are a big help in understanding how we achieve depth perception using binocular (p. 218, if that book's on your shelf) and monocular cues (p. 226). The two-eye mechanism works because information arrives at different parts of each of your eyes and your visual processors use those differences (and therefore trigonometry, really) to build a 3-D representation of what you're looking at. The one-eye mechanisms are easier to comprehend: Larger items appear to be closer, for example, than smaller items. It is helpful, I think, to look at a simplified stereogram so you can actually pick out the differences on the left and right sides.
So how these pictures work is deceptively simple: They capitalize on our ability to see in stereo, using cues we rely on for 3-D vision to give us a perception of depth when looking at a 2-D object.