How it works...
Basically, consider the math behind how your eyes are able to distinguish depths

If you consider the screen to be the plane S, it is those points of intersection which your mind uses to determine the depth of something.