Why is the work output of any real machine less than the work needed to operate it?

fricton reduce the work input

work is gained due to friction

work lost due to friction​