I came across a comment online which mentioned that one of the main benefits of having 2 eyes is that we can perceive depth. I tried closing one eye and seeing for myself if somehow everything would appear to be at the same depth but it doesnt seem to be the case. I checked online and apparently it is true that having 2 eyes improves depth perception, but why? With our eyes being able to vary their focal length, we are able to focus on objects up to our near point with even 1 eye, why does 2 improve depth perception and what does it have to do with the distance between the eyes?
two working eyes is indeed necessary for depth perception. If you experiment a little more with one eye closed, you will eventually discover that depth perception does in fact disappear with one eye, and you are forced to infer depth based on the sizes of objects and on which objects are visibly in front of others.
Scanning your head with one eye open lets you experience monocular parallax, as pointed out on the comments above, and people with monocular vision learn all these tricks to successfully suss out depth and perspective.
When you look at a scene with one eye, there are a lot of normally reliable depth cues: shadows, relative size. But if those cues are not reliable, as in the Ames room illusion, you can't judge depth.
There are ways to judge depth with one eye accurately, for example by moving your head side-to-side so that you view a scene from two slightly different directions. Juan Sandoval is a one-eyed baseball pitcher with a successful career.