When you press the brake pedal, the switch closes and completes the circuit. Very simple. I believe they are 4-wire plugs, 2 are used for the brake light circuit and the other 2 are used for the shift interlock solenoid to allow you to shift out of park.
If one of your brake lights work, but...