How does eye adjust itself to deal with light of varying intensity?

The iris adjusts the size of pupil according to the light of varying intensity.

When the amount of light is very high, the iris contracts the pupil and reduces the amount of light entering the eye. Whereas, when the amount of light is less, the iris expands the pupil so that more light can enter the eye and things can be viewed clearly.