Electrodynamics (electricity and magnetism) is governed by Maxwell's equations and the Lorentz force law, but that left it a little broken. It would take Albert Einstein inventing special relativity to fix it. If magnets are based on motion and motion is relative, how does that work?