The eye must form a sharp image on the retina whether the object is close or far away. Since the distance from lens to retina is fixed, the only way to keep the image in focus is to change the focal length of the lens itself. This adjustment is called accommodation, and it is carried out by the ciliary muscles, the ring of muscle attached to the lens through the suspensory ligaments.
The mechanism works as follows. When the ciliary muscles contract, the ring they form becomes smaller, the tension in the suspensory ligaments falls, and the elastic lens is allowed to bulge. A fatter lens is more strongly converging, so its focal length shortens and its power \(P = 1/f\) rises, which is what is needed for a near object. When the muscles relax, the ligaments pull the lens flatter, the focal length lengthens, and distant objects come into focus. In the thin-lens relation \(\frac{1}{f} = \frac{1}{u} + \frac{1}{v}\), the image distance \(v\) is fixed by the eyeball, so a change in \(u\) must be answered by a change in \(f\).
The other structures play different roles. The vitreous humour is the transparent jelly filling the eyeball behind the lens; it helps maintain the shape of the eye and refracts light slightly, but its shape is not adjustable. The aqueous and vitreous fluids have fixed refractive indices, so they cannot vary the focal length. The retina and its nerves detect the image and transmit signals to the brain; they take no part in focusing. When a question mentions a variable focal length in the eye, the required answer is always the ciliary muscle changing the curvature of the lens.