Back in the day with brushed motors, it was called regenerative braking, as they used the motor as a generator, and instead of using a resistor to short across, they directed the energy back into the battery. Brushless motors I assume would do the same, but they add the ability to change the pwm frequency of the braking for smoother, or more aggressive braking.