You know the failure by heart even if you never named it. The dinner party photo glows orange; the ski slope photo drifts blue; the portrait in a leafy park turns faintly green; and at the moment you took each picture, the world looked perfectly neutral to you. The disagreement is not about the camera's quality. It is about a problem the camera cannot escape: the color of the light itself. Every photo is built from the light illuminating the scene, and light is not neutral - a candle-lit room is filled with amber photons, overcast shade with blue ones. Your visual system quietly corrects for this so thoroughly that you never notice. A camera must solve the same correction with no knowledge of what it is looking at, and the software that attempts it - auto white balance - is, at bottom, a running guess. Understanding the guess explains almost every color disappointment your camera has ever handed you, including the reason a sensor can turn a violet flower blue in a phone photo for reasons that begin before white balance even gets its turn.
A sensor counts, it does not understand
The raw material of a digital photo is three numbers per pixel: how much red, how much green, how much blue arrived at the sensor. The trouble is that those numbers mix two unknowns into one measurement. The light reaching the sensor is the illumination multiplied, wavelength by wavelength, by the reflectance of the surface it bounced from. A white card under an amber lamp produces nearly the same sensor readings as an amber card under a white lamp - the numbers cannot distinguish them. To render colors the way you perceived them, the camera must first answer a question it has no direct way to answer: what color was the light? Only then can it divide the illumination's contribution back out. Get the illuminant wrong by tending amber, and the whole photo inherits the error; guess blue, and snowfields pay for it.
The statistics behind the guess
Auto white balance algorithms lean on assumptions about what scenes are usually like. The classic one is the gray-world assumption: that the average of everything in a typical scene, mixed together, should come out neutral gray, so whatever color cast the average shows belongs to the light and should be subtracted. Variations on this idea run through decades of research - statistical methods that estimate the illuminant from image content, learning-based methods trained on labeled scenes, and hybrid pipelines that combine several estimators and vote. One elegant strand of research showed that under natural daylight, the color of the light itself can be estimated surprisingly well from the statistics of an ordinary RGB photograph. Each method carries its own way of being wrong: gray-world fails when a scene is dominated by one color, because a field of sunflowers or a red-walled restaurant looks exactly like white light on a yellow or red world. That is precisely when your camera's guess - and your photos - go strange.
Your brain runs the better version
Your visual system faces the identical problem and solves it with advantages the camera lacks: memory, context, and expectations. It knows faces, paper, and sky; it exploits shadows and highlights to infer the light; it uses the surrounding colors as reference frames. The result is color constancy - the paper of a book looks white to you under noon sun, evening shade, and a reading lamp, even though the light reaching your eye from that page differs enormously across the three. It is why a shade of makeup matched in one store can betray you in daylight, as anyone who has chased a foundation shade between store and street light has learned - your own constancy can hide differences the lamp spectrum was quietly making. But constancy is also a calibrated expectation, which is why occasional photographs and illusions catch it out: when the context is stripped away, the discounting can land differently in two heads.
Where the guess goes wrong, and what to do
The practical failures follow directly from the assumptions. Monochrome rooms - autumn foliage, a pink bedroom, a restaurant bathed in amber - break the gray-world logic, because the scene really is one color. Snow and beaches over-expose the estimate in the other direction, pushing white toward blue. Mixed lighting is unanswerable in principle: a window's cool daylight and a lamp's warm glow cannot both be corrected with one global setting, so something in the frame must lose. Photographers respond by giving the camera what it cannot infer: setting white balance manually for the known light, or photographing a neutral gray card so the correction has ground truth instead of statistics. Phone makers increasingly stack machine-learned scene recognition on top. But the deepest fix is knowing what the camera is doing: it is not recording the color of the light, it is guessing it. When the guess matches your eyes, you credit the camera; when it misses, you are meeting the one thing your camera and your brain solve differently - and rebuilding a color from memory alone, as Color Matching makes you do, is the quickest way to feel how much context quietly helps.