Judging distance via depth perception is an important aspect of sight. Many animals, including humans, sense depth via by having 2 binocular eyes which see stereoscopically.
2 separate types of monocular cues provide depth perception for some animals. Some insects sense depth via motion parallax: image changes on the retina, the amount of which depends on the distance to an object. An insect typically gets motion parallax information by moving its head side-to-side and interpreting the differential.
Contrastingly, chameleons and other vertebrates use accommodation: focal adjustment and contrast. Accommodation is a technique distinct from motion parallax but to the same end: judging distance via snapshot differences. How much an image defocuses can be used as an absolute depth cue by comparing a defocused image with other images in which the same object is sharply focused or distinctly defocused. People use image defocus for a rough estimate of relative depth.
With their front eyes having 4 layers, jumping spiders have accommodation built in. Each layer presents a different focal plane, letting the spider mind to tell depth by comparing the different planes.
Biological trade-offs abound in eye form. Those trade-offs are not always readily apparent. Various vision systems evolved in specialized ways, adaptive to lifestyle.
Anableps have eyes specially adapted to their surface-dwelling lifestyle. Anableps float on the surface, with the top of their eyes exposed to the air, while the bottom half, along with their bodies, are submerged.
Each Anableps eye has a single lens but 2 pupils and corresponding retinas. One pupil keeps an eye on the sky while the other watches the water below. This give Anableps an unparalleled range of vision.