First of all, we can compare our eye to a camera.
There are many similarities between the human eye and a camera including a diaphragm to control the amount of light that gets through to the lens. This is the shutter in a camera. The pupil, at the center of the iris, in the human eye is the lens to focus the light and create an image.
Just like we focus on the moving train with a camera to get a clear picture, our eye also focuses on the object/point we are concentrating on, and then changes the focal length of the lens in our eye- as the lens in our eye can change its focal length.
That is why we can see far and near objects, moving objects, etc
Hope it helped.