Second law of thermodynamics
How does the second law forbid perpetual motion?
The first law already forbids creating energy. The second goes further. Even if the balance is preserved, no machine can take heat from a single source and convert it entirely into work. A part must always be abandoned to a colder source, and that part is lost for use.