Since most of the light entering your eye does not escape, your pupil appears black. In dim light, your pupil expands to allow more light to enter your eye. In bright light, it contracts. Light detected by the retina of your eye is converted to nerve impulses that travel down the optic nerve. Some of these nerve impulses go from the optic nerve to the muscles that control the size of the pupil.
More light creates more impulses, causing the muscles to close the pupil.
Part of the optic nerve from one eye crosses over and couples to the muscles that control the pupil size of the other eye. That's why the pupil of one eye can change when you shine the light into your other eye. In this experiment, the light reflecting from your eye passes through the magnifying lens twice - once on its way to the mirror and once on its way back. Therefore, the image of your eye is magnified twice by the magnifying glass. The size of your pupils actually reflects the state of your body and mind.