OK being the repository of the worlds knowledge, you might think this one would be on Wikipedia.
You would be wrong.
If you type it in you get a horrible choice between the the Insane Clown Posse song Miracles and the article called Magnet.
There is no page called How Magnets Work. Not even a redirect to someplace that explains this. http://en.wikipedia.org/wiki/Force_between_magnets would probably be the best place for a redirect.
Using a search engine online should answer the question, if your question is actually "How is a magnetic field created?" From http://www.howmagnetswork.com/
How is a magnetic field created?But what most people want to know is how does a magnet attract certain metals? Or, how does a magnet attract or repel another magnet? What is happening in the space between magnets that causes them to act as they do?
When current flows in a wire, a magnetic field is created around the wire. From this it has been inferred that magnetic fields are produced by the motion of electrical charges.