This is potentially a huge subject, so I'll give some quick highlights and you can ask for or search for the details you're interested in.
First, look at
Graham's website and click on "The Motor / Generators" on the left hand side. This should bring up an animated picture of a motor/generator similar to that used in the Prius. Note that this picture shows the winding generated magnetic fields following the magetic poles on the rotor. This pushes the rotor in the same direction it's currently spinning, so the device is behaving as a motor. If the winding fields were ahead of the rotor poles they would push the rotor in the direction opposite it's spin. This tends to slow the rotor down. It also forces current through the windings, so the device acts as a generator. The windings are connected via a rectifier to the battery, so whenever the voltage on a winding exceeds the battery voltage, current flows to charge the battery. When the winding voltage is lower than the battery, the rectifier doesn't let current flow from the battery.
There is a separate circuit consisting of 6 power transistors in an "H-bridge" which is controlled by the ECU to allow current to flow from the battery through the windings in the correct amount and direction to set up the desired magnetic fields in the windings.
The H-bridge is an active circuit which draws power from the battery to set up the winding fields to create the desired torque in the same or opposite direction as the rotor spin. When it's set in the opposite direction, the passive rectifier circuit converts the AC winding current into DC current that charges the battery.
So during regenerative braking, the MG torque opposes the motion of the car, slowing the car and recharging the battery.
The axel of the MG's rotor is connected to the wheels via the final drive assembly consisting of a chain and several fixed gears, a differential and a pair of drive shafts (one to each front wheel).