The human eye is a sophisticated mechanism. To understand it, we could take a camera model. Just as the camera focuses images on a film or on a digital sensor, the eye focuses them on a special layer called the retina. The retina has nerves which collect information on the images focused on it, and these nerves relay this information to the brain, which processes the images into what we see.

Refractive Cross Section of the Eye
Just like the camera needs lenses to focus images on the film, the eye also has lenses to focus images on the retina. The eye has two lenses: the cornea and the “lens”. The cornea is a fixed focus lens. It simply bends light rays by a fixed amount. The lens is like an auto focus system. It changes its shape to focus images perfectly on the retina, so that images appear sharp and crisp. While both lenses are important, it is the cornea which contributes 2/3rds of the bending power of the light.
Sometimes when there is a mismatch between the curvature of the cornea, the power of the lens and the length of the eye, the eye focuses images ahead of or behind the retina. This is known as a refractive error. This results in unclear vision, eyestrain and headaches. To eliminate this mismatch, spectacles or contact lenses need to be worn.