Why do pupils change size?
The short answer
In bright conditions the pupil becomes smaller; in dim conditions it becomes larger to regulate incoming light.
How it works
The pupil is an opening in the center of the iris. Its automatic adjustment helps protect the retina from sudden bright light and gather more light in darkness.
A familiar example
Pupil size can also change with emotions or other signals, not only with light.