Most controllers have dynamic brakes which simply short out the motor when the brakes are on. Any time a DC motor is turning it generates a voltage, even when it is under power. The voltage is opposite in polarity to the applied voltage and is referred to as the back EMF. When the motor is unpowered, but still turning, shorting it out causes it to stop faster. In order to have dynamic brakes there must be current flowing through the motor windings so that they generate a magnetic field. Higher end controllers have a potentiometer in the brake circuit that can reduce the amount of brakes. Some controllers have MOSFET brakes. With that type of brakes you get full braking as soon as you back off on the trigger and the brake control lets you adjust how long the brakes stay on.