Why do pupils change size?
Pupils change size to control how much light enters the eye. In bright light they shrink to protect the retina, and in dim light they widen to let more light in so we can see better.
The pupil is not a structure but a hole in the center of the iris, the colored part of the eye. Two sets of tiny muscles in the iris change the size of this opening.
One set of muscles forms a ring around the pupil. When it tightens, the pupil gets smaller. Another set spreads out like the spokes of a wheel, and when it tightens, the pupil gets bigger.
An automatic reflex
These changes happen without us thinking about it. The pupillary light reflex is controlled by the nervous system and starts within a fraction of a second when light levels change. Shining a light into one eye makes both pupils shrink.
Pupils also change for other reasons. They can widen when we feel excited, scared or interested, and they get smaller when we focus on something close up.
Doctors check pupils with a small light because unusual responses can be a sign of a problem with the brain or nerves.
This answer is general information, not medical advice. For a personal health question, talk to a doctor.