In the Scientific American Joss Fong examines the dilation of the pupils:
The visual cortex in the back of the brain assembles the actual images we see. But a different, older part of the nervous system—the autonomic—manages the continuous tuning of pupil size (along with other involuntary functions such as heart rate and perspiration). Specifically, it dictates the movement of the iris to regulate the amount of light that enters the eye, similar to a camera aperture. The iris is made of two types of muscle: a ring of sphincter muscles that encircle and constrict the pupil down to a couple of millimeters across to prevent too much light from entering; and a set of dilator muscles laid out like bicycle spokes that can expand the pupil up to eight millimeters—approximately the diameter of a chickpea—in low light.
Stimulation of the autonomic nervous system’s sympathetic branch, known for triggering “fight or flight” responses when the body is under stress, induces pupil dilation. Whereas stimulation of the parasympathetic system, known for “rest and digest” functions, causes constriction. Inhibition of the latter system can therefore also cause dilation. The size of the pupils at any given time reflects the balance of these forces acting simultaneously.
The pupil response to cognitive and emotional events occurs on an even smaller scale than the light reflex, with changes generally less than half a millimeter. By recording subjects’ eyes with infrared cameras and controlling factors that might affect pupil size, such as ambient brightness, color and distance, scientists can use pupil movements as a proxy for other processes, like mental strain.