What the contrast ratio number actually measures
The WCAG contrast ratio is calculated from the relative luminance of two colors — how much light they reflect relative to white. The formula uses linearized sRGB values and weights the three color channels by their contribution to perceived brightness (red: 21%, green: 72%, blue: 7%). The result is a ratio from 1:1 (identical) to 21:1 (black on white). What the ratio does not measure: perceptual color difference, hue contrast, saturation, or font characteristics. Two colors can produce a passing 4.5:1 ratio while sharing a hue and still being difficult to distinguish for red-green color blind users. The ratio is a luminance measure only — a necessary but not sufficient condition for accessible color use.
