They do this because they get inputs from bipolars that synapse with the type of receptors called cones. The rods are sensitive to almost all of the wavelengths of light, from longest to shortest, and their output is used to see shades of gray from black to white. The pattern of cone activity is highly specific to the wavelengths falling on the retina in the visual image. So, color vision depends on the cones. Notice that light itself has no color.
Light rays differ from one another by wavelength .
Color exists only in conscious minds. It is a nervous system's way of telling one wavelength from another. Color vision is simply a way of discriminating wavelengths. We have this ability because there are so many objects in the environment that do not reflect back all of the wavelengths that come to them from the sun. They absorb some and reflect back the rest.