Magnetic Motors - The end of gasoline?

If the law of physics says whatever output you get you must have equal or greater input, then how does a magnet work?

All my life I've played with magnets. There is energy there, so where is the input? I can hold a magnet up to my fridge and feel the power as it sucks to the metal. I don't plug it in, pour gas into it or hook it to a solar panel. It's just there, like magic.