The relationship between power, heat and efficiency
If the motor is 80% efficient, 20% of the electrical input is used to heat up the motor (internal wire and iron) and 80% is used to supply mechanical energy to whatever is connected to the shaft. That is mostly correct. A small amount of the lost energy is used to move air through the motor to carry the heat away. An even smaller amount is used to make the humming noise that you hear.

A certain amount of energy is lost in the wire between the power supply and the motor. That could be very little if the supply is close and the wires are large. The losses between a power generation station and motors in a factory average on the order of 7%.