Well this is the way it is: For every transformation of energy there are losses. Even a piece of copper wire has its resistance and there are not much you can do about that. If putting together things like motors, capacitors, inverters, alternators, and generators they all add to the losses.