That's literally their job. In an EV, and especially in my i3, letting off the accelerator pedal slows the car down dramatically, but this deceleration isn't a production of friction braking, it's actually the resistance associated with the electric motor acting as a generator to recharge your batteries.