The Nintendo 3DS produces the illusion of 3D using
autostereoscopy. You can imagine the screen as showing two images
at once, and having another screen (the parallax barrier) over it
to only allow each eye to see one screen. Basically, the screen
works by forcing each eye into seeing a different image. The screen
has two images; each image is a different perspective of the same
image, as if you were actually looking at a real object in real
life. In real life, your eyes both see a slightly different
perspective of the same object(s), and that provides the 3D effect,
as abjects closer to you will have a bigger difference in the
perspective. The same goes with the 3DS: it forces each eye into
seeing a different perspective. and as a result, your eyes are
tricked into seeing objects on the screen just as you see 3D
objects in real life. It's all about making your left eye see the
left side of the object, and your right eye seeing the right.
That's what creates the illusion of depth.
If that's too confusing: it's magic. It's a magic screen.