The brake light switch is a safety switch. Mounted under the dashboard on the brake pedal arm bracket, it is a plunger switch that sits closed when the pedal is resting. When you step on the pedal, the arm swings away from the switch plunger. The internal contacts close, sending electrical current to light up the red brake bulbs at the back of the car.
This switch does more than turn on lights. The engine computer reads this signal to disable the cruise control system, unlock the shift lever from Park, and enable the push-button starter. If the switch fails, your brake lights will stay dark, you won't be able to shift out of Park, and the engine may refuse to crank.