In my electromagnetic theory class, I learned that magnetic forces do no work. This is easy to see when observing a cyclotron; the speed never changes, so the kinetic energy never changes and therefore no work is done.
I then tried extending this logic to junkyard magnets, and now I am skeptical. The induced magnetic field appears to lift chunks of metal off the ground, directly opposing gravity and therefore changing the gravitational potential energy of said chunks.
So my question is, does the principle "magnetic forces do no work" fall apart in this case? Or is there something about the design of junkyard electromagnets that permits the principle to hold true?
Thank you in advance for your answers. :)