It rotates both wheels forward when the motor goes in the forward direction. Thing weird thing is, when going in reverse it has one wheel go forward and one go backward is to turn the car.
I don't know what this is called, but my suspicion is that this mechanism makes use of something very similar to a differential gear.
When the drive shaft is rotating in one direction, the pinion gear (green) engages with the ring gear (blue) as normal, but when the drive shaft is rotating in the other direction, the pinion gear engages with an extended side gear (cyan) instead, while locking the ring gear in place.
Since the ring gear is fixed in place, the torque going into the side gear directly would be translated via the spider gears (orange) into torque in the opposite direction on the other half shaft (red).
Thanks to Mallaky for the animated gif.