Braking in the straights allows you to enter the turn at the proper speed for your experience level, road conditions and your bikes capabilities. With this standard technique you have released the brakes before you begin your turn in. In doing so your suspension is set prior to beginning the turn.
Getting on the brakes, while in the turn, can cause the bike to "stand-up" and head toward the outside of the turn. About the only time you will have to get on the brakes in the middle of a turn is when you are in need of a quick stop. Such as when the deer walks out in front of you while riding on Parmalee Gulch in Indian Hills at dusk.
Trail braking is an advanced technique that requires a fair amount of practice. In trail braking one applies the brakes through the beginning of the turn. This has the effect of causing the front end to compress and changes its geometry (reduces rake and trail-hence the name trail braking).
The basics of front end geometry are rake and trail. Rake is the angle from a line drawn through the steering axis and steering head as it relates to a vertical line drawn up from the ground through the front axle. Trail is the distance between the contact patch (below the front axle) and the steering axis line.
The more rake and trail a bike has the more stable it is. Harleys and other chopper style bikes have increased rake and trail and thus they are more stable in a straight line, but harder to turn. Sport bikes have a very short angle and thus turn more easily and quickly.
The effect of compressing the front end via trail braking effectively reduces the trail angle and allows the bike to turn in more quickly. Then slowly releasing the front brake while simultaneously easing on more throttle will allow the bike to avoid fast (unstable) load transfers from the front tire to the rear. Avoid quick weight transfers as they can lead to loss of control.
As Bueller points out, slow in-fast out, is one of the best (most stable) methods of cornering.
In this photo it can be seen the front end is compressed while the rear suspension is under limited load all this while the bike is in full lean. Direct evidence of trail braking.
Of course, trail braking comes after the basics like: getting on the balls of your feet on the pegs and keeping them tight in to the bike, sitting back on the seat to keep your weight balanced on the suspension, setting your upper body up for the turn in, braking prior to the turn, looking through the turn, etc...