On mine, and I assume this is standard on all others although I haven't checked, there is a Breakaway Switch on the 5th wheel with a thin wire with a loop on the end which you attach with a pin to your hitch.
The theory is, when you are hooked up as long as this switch is in place the brakes on the trailer are not activated, unless of course you brake while driving. If the trailer somehow comes detached from the truck the wire pulls the switch out and the trailer breaks go on and stop the trailer. This of course assumes you are traveling with charged batteries.
If you google 5th wheel breakaway switch the is lots of good information.
I hope this makes sense and helps.:)