The iris works like the shutter of a camera. It is made up of muscles that regulate the amount of light entering through the central opening, or pupil.
The dilator muscle opens the pupil in low light conditions allowing more light through to the retina. The sphincter muscle closes the pupil in bright light to restrict the amount of light sent to the retina.
The iris has pigmentation that determines our eye color. When people ask what color are your eyes, they are referring to your iris.
Eye color is a genetic trait and depends on the gene contribution of each parent.