Color is a visual property of perception. Camera chip interprets the light that passes through the lens in a similar way as our brain interprets the light passing through our eyes. Our perception of color is a result of the journey undertaken by light.
Light travels from the light source onto an object and then it bounces off the object and continues to travels through our eyes onto receptors. Then information received is processed by the brain. The brain, being very considerate of our psyche, it balances the color of the light to a white point (simulating daylight).
The camera works in a similar manner as the human eye + brain: the light enters the lens and falls onto sensor and then the data gets processed and the software/firmware assigns corresponding values based on camera settings.