The human retina contains three different types of cones. They are red, blue and green. Each cone is connected to the brain via a nerve fiber. When they see a certain color the right amount of each cone is stimulated to send a special signal to the brain. The brain then infers the signal and interprets it as whatever color the eye is seeing.
Thanks to the three possible cones and millions of different combinations, the brain can interpret many different colors; hence, it is not the brain, which makes the differentiation. In fact, the color differential is made at the level of the retina.
Human beings are able to differentiate between colors due to the color cones that they have in their retinas. Normally, humans tend to have three different cones in their retina. These include cones for red, blue, and green color.
After light falls through these cones, the brain receives the information and perceives the color. Since each cone can see 100 shades, a combination results in 1 million shades that the human eye can differentiate provided that one is not color blind. This is how the human eye is able to differentiate different colors. Primarily, it is because of the cones in our retina.