system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Seriously, how do magnets work?
gpt
A moving charge (a charge could be an electron) creates a magnetic field. There are two common types of magnets. Consider an electron orbiting the nucleus of an atom. This is a moving charge which creates a magnetic field. If every electron orbit of each nucleus in a macroscale object is aligned, all their magnetic fields will combine to create a strong field. This is how standard fridge magnets work. There is also what we call an electromagnet. Electromagnets use electric current to move charge and hence create a magnetic field. If your wire is looped many times around a circle, all the moving charge (current) combines to create a strong magentic field. Hopefully this gives you a rough idea of how fields are created, but there is more to the magnetic force.

A magnetic field can only act on other moving charges. This is why two magnets stick together (or repel each other), but a magnet might not act on a different object. The moving charges of one magnetic create the magnetic field which acts on the moving charges of the other magnet. If a magnet doesn't have a force on an object, it is because the electron spins of the other object are oriented in random directions, so the magnetic field creates a force on each nucleus that is in a random direction, and therefore the net force on the macroscale object is 0. 

Some types of metals will have disordered electron spins, so they dont act as a magnet, BUT when put the metal in a magnetic field, the electron spins of each nucleus will align and the metal can then experience a net force from the magnetic field. This is why magnets will act on some metals even if they weren't magnetic to begin with.

Hope this helps. Please ask if you have questions about any of this.