Human eyes chose at some point of evolution to detect three colours. And those colours were chosen for their importance and abundance, and the chances those colours gave them to differentiate visually things in their environment:
- Blood. It's main component, hemoglobin, lets out a red wavelenght. Blood was important to see right away, and its light comes out from many animal skins also. Hemoglobin is the main oxygen transport molecule for most animal species.
- Chlorophyl. Is essential for plant food production, and is the background colour of many sights humans (or apes) would encounter in their environments. So it was good to see that colour to sort out any other thing in front or behind leaves, that would most probably not be green.
- Sky. Air scatters blue sunlight. The rest of the light is transmitted through the sky, and so comes down only in line with the sun, where as blue light is scattered throughout the sky and appears to come from all directions (though brightest near the sun). The blue sky would also be a frequent background, and like wise green, it would be an advantage to single out other things against a blue sky background.