system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do magnets form, and why/ how do they do what they do?

Edit: I had no idea this would blow up so much! Thanks everyone for all the information!
gpt
All matter is made out of atoms. An atom can be thought of as a small nucleus of material around which orbit even smaller particles of matter called electrons. The electrons have an electrical charge, so when they orbit they form small loops of electrical current around each nucleus. Magnetic fields are formed by electricity. In most materials the little magnets formed by each atom are all pointing in different directions, and so they cancel each other out. In some materials such as lodestone, an iron ore, the Earth's magnetic field lined up all the atom-magnets and left the whole stone one large magnet.

People have used naturally occurring magnets for thousands of years. Once people found that other materials could also be made into magnets, they started producing stronger magnets by a variety of different processes. Certain metals can be made into magnets by exposing them to magnetic fields. Although just placing the metal in a magnetic field can work, making it vibrate increases the effect. Stroking the metal with the magnet also increases the effect. Heating the metal up while it is in the field and hammering it while it cools increases the effect even further. Steel and iron make good magnets. So does an alloy of aluminum, nickel, and cobalt called alnico.