If you can find a mirror you can look at your own eye. You will notice there is a black central bit (the pupil) surrounded by a colored ring (the iris). The pupil is a hole that leads into the dark interior of the eye, the back of which is the light-sensitive part (the retina). The colored ring is a band of muscle which can expand and contract to make the pupil larger or smaller.
The retina needs to be protected against excess light and have access to more light if there isn’t much around. To do this the iris will expand in dim conditions making the pupil larger to let more light in, and in bright conditions the iris will contract making the pupil smaller to let in less light.
When you looked at a light your iris contracted, so when you look away there is less light allowed into your eye and things will look dim.
Latest Answers