No device transfers all of the energy supplied to it usefully. The efficiency of a device tells you what fraction of the energy supplied is usefully transferred.
The equation is:
efficiency = useful energy transferred by the device ÷ total energy supplied to the device
Both energies are measured in joules (J), so the efficiency has no unit. It is a number between 0 and 1. Multiply by 100 to give a percentage. An efficiency can never be more than 1, or 100%, because a device cannot give out more useful energy than it is supplied with.
Example: a motor is supplied with 500 J of electrical energy and transfers 400 J usefully. Efficiency = 400 ÷ 500 = 0.8, or 80%. The other 100 J is dissipated, mostly as thermal energy. That is 20% of the energy supplied.