Xcarguy has it correct, there is a switch that is activated by separation of trailer from tow vehicle. That switch connects a battery on board the trailer with all the trailer's brakes, locking them on full, until that pull-out pin is put back into the switch, opening up the circuit.
Highway DOT inspectors, if they have pulled you over for another reason, will always check to make sure they hear the "hum" of the magnets when they ask you to pull that break-away pin. I am upgrading the wiring pigtail on one of my 8 or 9 trailers (I've lost count) and will replace that break-away switch along with the 7 wire pigtail and add a junction box for the pigtail-to-trailer connection.
Tom