The mind did not evolve to see the world "as it is,' but to see the world in a way that proved useful to see in the past. In short, the brain evolved to continually redefine normality by finding the relationships that were useful in our evolution and development.
Everything we (or our ancestors) have seen goes to inform how we see the world. That is why we can interpret a visual image as a 3-dimensional scene, and our visual system immediately estimates a lighting vector and uses this to judge the property of the material. Ah, but try to translate that 3-D on a 2-dimensional surface, and you have to "undo" all that your brain has learned to understand about space and perspective, and re-learn to see what is actually there. That is why if you are painting a model from life, let's say she is reclining with her lets bent (as if curling up in a ball), tops of the feet toward you and her head away from you, her hip may fall in the same horizontal line as that of her breast. The same is true with the "undo-ing" of light and shadow illusion.
The visual system needs to determine the color of objects in the world. Just measuring the light coming from a surface (luminance) is not enough: a cast shadow will dim a surface, so that a white surface in shadow may be reflecting less light than a black surface in full light. The visual system uses several tricks to determine where the shadows are and how to compensate for them, in order to determine the color of "paint" that belongs on the surface.
In the painting shown above, it is truly believable that the flat, highly reflective surface on which the lemons and vases sit, is only made up of one material... not many different materials all tiled together. Yet the differences in color along the table's surface is varied. Our brains believe it when we see it "live" just as they believe it here. These changes along the surface of the hutch are due mostly to the reflections of surrounding objects.
Now, imagine that you are looking at a shiny new red car. It is sitting in bright sunlight. The top of the hood is reflecting the highly chromatic red paint. But does it look red... as in the color out of the spray can that was used to paint it red?? Now, follow the curve of the fender, the surface moves into shadow. Still, your mind compensates for the less intensely reflected light and perceives that the paint on the fender is the same color used to paint the rest of the car. How does your mind do this?
The first trick is based on local contrast. In shadow or not, an area that is lighter than its neighboring area is probably lighter than average, and vice verse.
The second trick is based on the fact that shadows often have soft edges (at least at some point along them), while paint boundaries have sharp edges. The visual system tends to ignore gradual changes in light level, so that it can determine the color of the surfaces without being misled by shadows.
The brain also uses statistically abundant experiences to perceive mad-madeness. When confronted with a line or form that is unnaturally symmetrical or precise, the brain interprets changes in the surface color rather than in terms of shadows or lighting.
Of course as artists, we know that we should not just think of the car's hood as red and the car's fender as red any more than we should think of the top of the hutch in the painting as brown. We know that we should think of each of those surface planes as different colors altogether, (everywhere there is a plane change, there is a color change)... and that along with those plane changes we also experience colors bouncing from surrounding objects. So here again, we are having to re-learn what we are really seeing, to stop ignoring the truth, and to ignore what our brain wants us to perceive, which is that the car is red and the hutch is brown.
Have you ever painted a painting and wondered why it isn't believable in terms of color? Perhaps it is a white wall in shadow, and you opt to go overboard based on the success of someone else's painting you thought you understood. Now, it looks like a blue wall rather than a white wall in shadow. As with many so-called illusions, this effect truly demonstrates the success rather than the failure of the visual system. The trick as artists, is learning to use these illusions for good (rather than evil)... that is, to know when to use them and when not. This is where your visual intention must supersede your power of the knowledge of color. Restraint is often times the higher road to take.