
Metering systems are calibrated to a certain light value in order to gurantee constant exposure settings: 18% gray is commonly accepted because a typical scene seems reflect the same amount of light as this gray value.
As a framework for comparison all these colors reflect light like 18% gray.
Usually this assumption works pretty good but if you expose a scene with a majority of bright colors/grays without compensation in spot or center-weighted mode the camera will darken the picture to 18% gray – the result is under-exposed. On the contrary a scene with lots of very dark colors/grays will be lightened up to this gray value – the result is over-exposed. The camera cannot differ between a white wall in shade or a gray wall in sunshine because the amount of incoming ligth is identical. Most cameras are blind in regard to colors – with just one exception (the Nikon F5) they analyse the world based on different light metering values.