An electric motor brake is basically an ordinary electric motor run backward. Instead of supplying the motor with electricity to make the shaft turn, some outside force (usually from the wheels of a train or car) is applied to the shaft to make it turn, which results in the generation of electricity.
A motor works when electricity is sequentially passed through separate coils of wire (that are designed and placed strategically around a permanent magnet attached to a central shaft), which generate magnetic fields. These magnetic fields turn on and off according to the orientation of the central magnet as it rotates to the effect of putting a constant feeling of torque on it, making it turn.
With no electrical input, it takes energy to turn the shaft because a force is required to spin the central magnet against the push of the wire coils. At high speeds (or revolutions per minute) this can be a substantial force, enough to slow down a car. This is why one of the applications for this technology is braking. Not only does it save the brake pads from wearing out, it also charges the battery. However, one of the limitations of electric motor braking is that its effectiveness decreases at lower speeds since the central magnet feels less force when it's spinning slower. This is one reason why this system also requires friction brakes to work properly in cars.