The switch "should be" wired to your trailer battery. It does not have its own battery.
The cable is attached to the pin that pulls out of the switch, if the trailer breaks away from the tow vehicle. When the pin pulls out the trailer battery supplies power to the electric brakes on the trailer, hopefully stopping it without any further damage.
Additional advice: do not pull the pin to act as a parking brake. If you keep electric brakes powered (energized) they will burn out and need replacement. The pin is suppose to activate the brakes in an emergency not as an everyday parking brake.
5er/2500Duramax/18ftBoat