Short answer:
- Proteins or photopigments involved in vision have different sensitivity to light
- The transduction paths are different or the paths to produce/mantain the proteins/photopigments.
Generic answer:
The proteins or photo pigments responsible for sensing light usually undergo a conformation change/chemical change induced by light, but this change depends on the wavelength of the incident light. There are many different proteins that are light sensitive and the reasons why this reaction happens on a specific wavelength interval and what kind of reaction happens depends on the protein. However, not only different proteins react differently to light, but also what happens next may be different. After the protein suffers a change because of light (whatever that is) a long chain of chemical reaction begins which will end up as an electrical signal. Also, usually proteins or photopigments have to be recycled after being activated/bleached, which is done by parallel biochemical pathways. Mistakes on these paths will also after the ability of seeing a specific colour.
Example:
There are many kinds of vision mechanisms in the animal kingdom. The colours (sets of wavelength intervals) that each animal sees highly depends on the set of proteins that these animals have and the transduction path after the proteins are activated. We humans, for example, are good at seeing green and other colours that help us to identify food that we usually eat [1]. Interestingly, even small changes on the aminoacid sequence of the proteins change its sensitivity for light. For example, some people have cones (some of the cells responsible for vision in humans) with photo pigments that are sensitive at 530 nm and some people are sensitive at 562 nm. This difference is caused by only 3 aminoacids substitutions in a protein [2]. Another example involving the recycling pathway of a photopigment can be found at [3]. It was observed that some mutant Drosophila flies had their vision impaired because they could not keep the concentrations of the visual pigment Rhodopsin.
[1] Surridge, Alison K., Daniel Osorio, and Nicholas I. Mundy. "Evolution and selection of trichromatic vision in primates." Trends in Ecology & Evolution 18.4 (2003): 198-205.
[2] Neitz, Maureen, Jay Neitz, and Gerald H. Jacobs. "Spectral tuning of pigments underlying red-green color vision." Science 252.5008 (1991): 971-974.
[3] Ostroy, SANFORD E. "Characteristics of Drosophila rhodopsin in wild-type and norpA vision transduction mutants." The Journal of general physiology 72.5 (1978): 717-732.