The trailer service brake control lever ("johnny bar" in trucker lingo) has many uses. Most all of the examples given so far are true. The lever is used to control the service brakes not the emergency brake (also referred to as parking or spring brake system) on the trailer. It can input 0-120psi (or whatever full psi is at any certain time) and is independent of the foot pedal. It can be used independently of the foot pedal or in conjunction with the foot pedal, but can only add to the psi being applied by the foot pedal (to the trailer service brakes only) not decrease applied psi. It's use during attaching or detaching a trailer is not practical since you typically would have air lines detached during those operations. Some of the most common uses (not necessarily in order) would be:
1. Testing fifth wheel/king pin connection. (Could also be tested using trailer parking brake)
2. Testing trailer service brakes. Helps driver to feel and evaluate adjustment, air lag, and sensitivity of trailer brakes. Each trailer is different and knowing how the trailer brakes are going to react (or not react) is good to know.
3. Sliding trailer tandems. Also can (and usually is) be done with trailer parking (emergency) brake set, but is sometimes necessary with heavy loads, stubborn (poorly greased) tandems/rails, or weak parking (spring) brakes.
4. Supplemental braking. If you have poorly adjusted trailer brakes or poorly distributed weight (heavy on trailer tandems, light on kingpin) extra air pressure can be applied (over and above foot pedal) to trailer which will facilitate a shorter safer stop.
5. Holding vehicle on incline. Used to hold vehicle on incline (in traffic or the like) to prevent vehicle from rolling backwards while engaging clutch. Do not use as parking brake! Most will not stay engaged without input from the driver and will slowly disengage due to air pressure on other side of valve if not physically held in place.
6. Emergency bypass of tractor brakes. If a catastrophic failure (blown service air line) of the tractor service brakes occurs
trailer brakes can be used independently to stop vehicle and/or get vehicle to safe place without depletion of air pressure.
7. Preventing jackknife. If tractor drive tires loose traction (typically during mid-high speed cornering on off ramps or the like) and the trailer is "pushing" the tractor the trailer service brakes can be applied to "pull" the tractor straight.
8. Controlling "wag" (as put in previous post). Typically not a big problem with a fifth wheel trailer unless weight distribution is WAY off on a single combination vehicle but is used fairly often to settle down a set of doubles (they are called wiggle wagons for a reason).
9. Isolating air leaks. If you have an air leak in your service brakes you can apply air to trailer only and watch air gauge for reduction in air pressure, if none, then you have isolated leak to tractor.
Obviously there can be other uses and all these examples may not be applicable to all situations/vehicles but are the most common and practical applications in my experience.