Enthusiastic layperson here, curious about magnetism:
Scenario 1:
Imagine that I lift a piece of iron with my arm from a tabletop a fixed distance upwards, then place it back on the table.
In this scenario, the energy required to lift the mass against gravity comes from the nutrition that I eat. Furthermore, if I repeatedly lift the weight without replenishing those calories expended by my lifting muscles I will eventually reach a point where there is no more energy available to make the lift. Of course I'll probably have starved by then, but hopefully I've gotten my point across: a supply of energy is required for my muscles to lift the iron.
Scenario 2:
Imagine now that instead of lifting the iron with my muscles, I hover a magnet over it from the same height. Just like my muscles, the magnet lifts the iron against gravity.
I know where the muscular energy required to lift the iron comes from. But where did the energy required to lift the iron by the magnet come from?
I then remove the iron from the magnet, place the iron back on the table, and repeatedly lift the iron using the magnet. My understanding is that the magnet will continue to repeatedly lift the iron without losing its strength.
How is the magnet resupplied with energy so that it can continue to lift the iron?