system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5 How do magnets not violate the conservation of energy?

I have a pair of magnets with a top magnet on one side of a wooden shelf and other on the bottom of the shelf. They've been like this for a year. The earth's gravity is constantly pulling the bottom magnet and the top magnet is pulling as well. Will the top magnet ever run out energy?

EDIT: Thank you everybody!
gpt
It doesn't need energy to stay in the same place, just like the shelf doesn't need energy to stay where it is (the shelf is also held up by electromagnetic forces between the atoms in it). You would only need energy if you were moving the magnet to where it has more energy (like pulling it further away from the other magnet) or if you were giving it kinetic energy by speeding it up. Since it's not moving and it's not getting further from the other magnet, the energy stays the same.