It triggers when the front, rear, or both sets of brake pads reach a certain thickness. A sensor is slotted into the brake pad, and when the pad wears down enough to expose the sensor to the rotor, that contact trips the sensor and turns the light on.
There is one sensor in the front and one in the rear, at opposing corners.