Very bright light can damage the retina — so you have a reflex to protect it.
1) Very bright light triggers a reflex that makes the pupil smaller, allowing less light in (in this case, light receptors detect the bright light and send a message along a sensory neurone to the brain. The message then travels along a relay neurone to a motor neurone,
which tells giroular muscles in the iris to contract, making the pupil smaller.)
2) The opposite process happens in dim light. This time, the brain tells the radial muscles to contract, which makes the pupil bigger.