> So the gyst from what I understand is that when you hit the brakes in a hybrid or electric car the motor that turns the wheels start spinning backwards.
Not quite. They keep spinning the same way but they act as a generator instead.
Moving a conductor through a magnetic field will cause a current in the conductor, and a current flowing through a conductor forms a magnetic field. This is how electromagnets are used to make an electric motor spin, as the current applied will form magnetic fields as necessary. Similarly spinning a motor with an outside force will cause it to generate electricity.
An electric motor and an electric generator then are in essence the same sort of device, the difference being if energy is being applied from the electricity side or the physical force side.
With regenerative braking electricity is applied to cause the wheels to turn, then when you want to stop the momentum of the car causing the wheels to turn is used to generate electricity, in the process helping to stop the vehicle.
The motor doesn't reverse for regenerative braking. It's just like engine braking in an ICE car where you change down gears and let the engine slow you down. With an electric car the gearing is effectively in the electronics between the motor and the battery and the battery can use the power coming back to recharge.
the motor doesn't spin backwards. Mechanically, a generator is the same thing as a motor. Turning a generator creates resistance because the coils in the motor are cutting through magnetic fields, cutting through the magnetic fields causes current to flow through the coils recharging the battery.