Depth perception is created when you view an object with two eyes and both the eyes
create two slightly different images. The brain interprets the two images and merges
them in to one image, giving depth perception. This depends on binocular vision where
the fields of vision of each eye overlap. So basically the eyes (because they are on different positions on your head with different angles of view) merge the two images together and when this happens you are able to judge the distance of something.
Hope this helps a bit.