The pupillary response is the iris dilator muscle's response to a variety of different stimuli that varies the size of the pupil of the eye. Changing light conditions, changing focus, drug use, or a variety of other factors can cause this response. Changes in external lighting are among the most common causes of the pupillary response, as many organisms tend to experience a variety of different light conditions over the course of a day. The pupil tends to become smaller when more ambient light is available and larger when there is less available light. This relates to the pupil's purpose of receiving external light — the pupillary response moderates the amount of light the pupil receives in order to bring about the best conditions for vision.
Constriction or dilation of the pupils in response to differing light conditions is a form of pupillary response known as the pupillary light reflex. The reflex involves a variety of different neurons that sense incoming light and trigger the action of the iris dilator muscle. This reflex is highly important in medicine, particularly for diagnostic purposes. If the eyes do not experience the proper pupillary response to direct light, it's possible there is something wrong with the eyes or brain stem, or that the subject has taken depressant drugs of some sort.
The pupillary response also occurs quite frequently when an individual changes focus from a distant object to a nearby object or vice versa. This is a part of the accommodation reflex, which encompasses a variety of changes in the eye related to changing focus. Close objects dominate a large area of one's field of vision, so the pupil tends to be larger to receive light input from wide angles. Distant objects, on the other hand, take up a much smaller part of one's field of vision, so it is necessary to constrict the pupils, as taking in light from wide angles would only distort the distant object.
Researchers and medical professionals use a variety of different methods to test and measure the pupillary response. One of the most common methods for simply testing if the response occurs is shining a light directly into an individual's eye. Other techniques such as video pupillometry can be used to measure and record changes in pupil size in response to a variety of different stimuli. Measurement of the pupillary response is important both for diagnosing eye and nervous system problems and for researching the nuances of normal and abnormal pupil physiology.