There is a photograph, familiar to anyone who has taken an introductory psychology course, of a chequerboard with a green cylinder casting a shadow across it. Two squares are marked. One sits in the light and looks dark grey; the other sits in the shadow and looks pale. They are printed in identical ink. Told this, most people refuse to believe it, cut out two paper masks, check, and feel cheated.

That feeling of having been cheated is the wrong reaction, and understanding why is the whole point of studying illusions. Your visual system was not fooled by a trick. It was doing precisely the job it evolved to do, on an image constructed by Edward Adelson specifically to punish it for doing that job well.

Vision is guesswork, and it has to be

The image landing on your retina is a two-dimensional pattern of light intensities, and it is fundamentally ambiguous about the world that produced it. A dim white surface and a brightly lit grey surface can send identical light to your eye. A small nearby object and a large distant one can project the same size. The retina cannot tell you which; there simply is not enough information in the signal.

Hermann von Helmholtz named the solution in the nineteenth century: unconscious inference. The brain does not read the image, it makes an informed bet about what arrangement of objects, surfaces and lighting would most plausibly have produced it, using assumptions built up over evolutionary and personal history. Light usually comes from above. Surfaces are usually rigid. Objects usually do not spontaneously change colour. Modern accounts dress this in the language of prediction and Bayesian inference, but the core claim is unchanged. Seeing is a highly educated guess, arrived at so fast and so confidently that it does not feel like guessing at all.

An illusion, then, is a situation engineered so the assumptions are wrong. The inference runs correctly on faulty premises and delivers a confident, incorrect answer. Every illusion is a signpost pointing at one of the rules.

Lines that lie about their length

The Muller-Lyer figure is two lines of equal length, one capped with outward-splaying fins, the other with inward-pointing arrowheads. The first looks reliably longer. Richard Gregory's influential explanation treated the fins as depth cues: the outward version resembles the inside corner of a room receding away from you, the inward version the outside corner of a building jutting towards you. If a line looks further away but projects the same size on the retina, the sensible inference is that it must be physically larger, so the visual system scales it up. Size constancy, misapplied.

The Ponzo illusion makes the depth story more explicit. Two identical bars lie across a pair of converging lines, like sleepers on a railway track vanishing towards the horizon. The upper bar, sitting where the rails have narrowed, looks longer, because converging lines read as distance and distance triggers the same rescaling. Something similar is at work in the moon illusion, the enormous harvest moon on the horizon that shrinks as it climbs the sky, despite occupying an unchanging fraction of your visual field.

The depth-cue account is elegant, and it should be flagged as incomplete. Anthropologists in the 1960s proposed that people raised among straight lines and right angles would be more susceptible to Muller-Lyer than people raised among round dwellings and open landscapes, and reported cross-cultural differences supporting it. That carpentered-world hypothesis has attracted decades of methodological criticism, and the size and reliability of the differences remain disputed. The illusion is robust; the tidy explanation for it is still argued over.

Grey is a conclusion, not a measurement

Back to the chequerboard. What your visual system reports is not the amount of light arriving from a surface but its best estimate of the surface's reflectance, the proportion of light it throws back. That estimate is far more useful, because reflectance belongs to the object while intensity depends on whatever the sun and the lampshade happen to be doing. Coal in bright sunlight sends more light to your eye than paper in a cellar, and you have never once been confused about which is black.

To pull it off, the brain discounts the illuminant: it detects the shadow, works out roughly how much light that region is missing, and adjusts. A square in shadow that returns a middling amount of light must be a pale square, because a dark square in shadow would return far less. Adelson simply arranged for two squares to arrive at your eye with matching intensities under conditions where the correct answer is that they are different. The visual system reports the correct answer about the depicted world and the wrong answer about the ink.

Neurons that adapt, and edges that sharpen

Some illusions expose the hardware rather than the reasoning. Stare at a waterfall for a minute and then look at the rocks beside it: they will appear to drift upwards while going nowhere. Robert Addams described the effect in 1834 after watching the falls at Foyers. The explanation is neural adaptation. Populations of direction-selective cells signal motion by their relative activity, and prolonged downward motion fatigues the downward-tuned population, leaving the upward-tuned one temporarily dominant when the scene goes still. The same logic produces colour afterimages: bleach one channel and its opponent wins the argument for a few seconds.

Then there is lateral inhibition, in which an active neuron suppresses its neighbours. The consequence is enhanced contrast at boundaries, which is enormously useful for finding the edges of things, and which shows up as Mach bands, the illusory bright and dark stripes that appear along the joins of a graded strip. Textbooks have long used the same mechanism to explain the Hermann grid, the array of black squares where phantom grey blobs flicker at the white intersections. That explanation deserves an asterisk. Peter Schiller and Christina Carvey argued in 2005 that the classic retinal account fails: distorting the grid in ways that should not affect ganglion cell responses can abolish the illusion, while changes that should matter do not. Their alternative points to orientation-selective cells further along in visual cortex. The textbook version survives largely by inertia.

The dress, and why it split the world

In February 2015 a badly lit photograph of a dress divided the internet into people who saw white and gold and people who saw blue and black. What made it remarkable was not the disagreement but that each camp found the other's report incomprehensible.

Colour, like lightness, is inferred rather than measured. Daylight is bluish, incandescent light yellowish, and your visual system continually subtracts its estimate of the illumination to recover the colour of the object. The dress photograph is unusually poor evidence about its own lighting: the background is blown out and there are almost no cues. Faced with genuine ambiguity, different observers land on different assumptions. Assume cool bluish daylight and the brain subtracts blue, leaving white and gold. Assume warm artificial light and it subtracts yellow, leaving blue and black.

Rosa Lafer-Sousa, Katherine Hermann and Bevil Conway documented the split experimentally shortly afterwards, showing that the divide was stable and categorical rather than a matter of quibbling over shades. Pascal Wallisch later surveyed around thirteen thousand people and found that their assumptions about the lighting predicted what they saw, with a modest association to how much daylight or artificial light people habitually lived under. The dress was not a defect in anyone's eyes. It was an ordinary inference process running with the evidence removed, and it revealed that our priors are not identical.

Why this is good news about your brain

It is tempting to file illusions under human error. That gets the logic backwards. A system that reported raw retinal intensities would never be fooled by Adelson's chequerboard, and would also be useless: it could not tell you that the wall is one colour despite the lamp, or that the distant figure is adult-sized. The assumptions that generate illusions are the same assumptions that deliver a stable, meaningful world almost every waking second.

Illusions are the rare cases where a very good inference engine can be caught working. That is why researchers value them so highly, and why the correct response to discovering the two squares are identical is not embarrassment but a certain amount of respect.