If there are no losses in the machine, then no external power supply would have needed. But due to the drop in the generator output voltage we need an extra voltage source to supply the proper input voltage to the motor. Hence, the power drawn from the external supply is therefore used to overcome the internal losses of the motor-generator set.