You want the breakaway switch to lock the trailer brakes only after the trailer has broken the safety chains and is no longer connected to the tow vehicle (TV).
So the breakaway cable should be a bit longer than the safety chains. If the trailer gets off the ball but is still restrained by the chains, then you're still okay. Stop and repair as necessary. But if the trailer gets completely disconnected from the TV, then you want the trailer brakes to lockup and stop the trailer before it can run over someone and mash them into a greasy spot.
Most TTs use the house battery to power the trailer brakes if the breakaway switch is pulled. So that's usually a safe setup. But cargo and horse trailers and some other trailers don't have a "house" battery, so they have a tiny 12-volt battery on the tongue of the trailer that's used only to power the breakaway switch. That small battery needs to be checked to be sure it's still good before you hit the road each time. If you pull the breakaway switch out of the connection and the electric brakes don't lock up, you've got some maintenance to do before you hit the road.
Grumpy ole man with over 50 years towing experience. Now my heaviest trailer is a 7,000-pound enclosed cargo trailer, RV is a 5,600 pound Skyline Nomad Joey 196S, and my tow vehicle is a 2012 F-150 EcoBoost SuperCrew.