Electric brakes work off an electric motor that powers them. The system is backwards from a regular electrical motor. A regular motor works the shaft with electricity forcing it to turn.
The way an electric motor works is by the electricity moving through the wires in effort to move a centralized shaft by way of an attached magnet. The magnet helps the shaft to turn, giving it torque, when they turn off, the torque, or turning stops. If the magnet changes orientation, the magnetic fields of electric wires will work or not work according to the orientation. Unless you are an expert at how this works and you try to break into the system to repair it you may mess it up more. Only qualified electricians should attend to the inner workings of electrical motors.
The electric brake is a big part of the electrical system; it is not something you want to go out, if it ever did, always call a qualified auto electrician to repair it.
When the electricity stops flowing, the shaft that turns the wheels are forced to spin the opposite way. This is what helps the vehicle to brake. The faster the vehicle travels, the more revolutions goes with each minute, the more force it makes for braking with the vehicle. This actually helps to preserve brake pads, and because it produces electricity, it helps to build up the battery charge. Ironically the effectiveness of electric brakes goes down at slower speeds, because the magnet in the center is spinning at a slower speed. This is why it is important to have friction brakes to help vehicles completely stop when needed.