As it was explained to me, there is always some input energy that is not available to be converted to useful work, and must instead be radiated as waste into the Universe at large. This is the 2nd law of Thermodynamics. To understand better, imagine a goldmine with large nuggets of pure gold lying at the bottom of the shaft. Now imagine a frictionless pully with a rope running through it with a bucket attached to each end, such that when one bucket goes up, then the other goes down, and vice versa.
Now, your assistant loads one bucket down below with 20lbs of gold that you desire to bring up out of the mine. So you add 20 lbs of ordinary rocks to your bucket up top. Does the gold come up? No. Why not? Because you have set up a 100% efficient energy exchange. What must you do to bring the gold up out of the mine? You must add 1-2 more pounds of rocks to your top bucket. Now the excess weight will drive your bucket down, while bringing the gold up. You must always add extra rocks to the top bucket in order to drive the system forward and recover the gold from down below. That is the 2nd Law of Thermodynamics at work.
Therefore no machine that is 100% efficient can perform any useful work.