How magnets(Alnico magnets) work

What exactly makes a magnet stick to certain metals? By extension,why don't they stick to other metals? Why do they attract or repel each other, depending on their positioning? And what makes neodymium magnets so much stronger than the ceramic magnets we played with as children?
To understand the answers to these questions, it helps to have a basic definition of a magnet. Magnets are objects that produce magnetic fields and attract metals like iron, nickel and cobalt. The magnetic field's lines of force exit the magnet from its north pole and enter its south pole. Permanent or hard magnets create their own magnetic field all the time. Temporary or soft magnets produce magnetic fields while in the presence of a magnetic field and for a short while after exiting the field. Electromagnets produce magnetic fields only when electricity travels through their wire coils.
Until recently, all magnets were made from metal elements or alloys. These materials produced magnets of different strengths. For example:

  • Ceramic magnets, like the ones used in refrigerator magnets and elementary-school science experiments, contain iron oxide in a ceramic composite. Most ceramic magnets, sometimes known as ferric magnets, aren't particularly strong.
  • Alnico magnets are made from aluminum, nickel and cobalt. They're stronger than ceramic magnets, but not as strong as the ones that incorporate a class of elements known as rare-earth metals.
  • Neodymium magnets contain iron, boron and the rare-earth element neodymium.
  • Samarium cobalt magnets combine cobalt with the rare-earth element samarium. In the past few years, scientists have also discovered magnetic polymers, or plastic magnets. Some of these are flexible and moldable. However, some work only at extremely low temperatures, and others pick up only very light weight materials, like iron filings.
Measuring Magnets
You can measure magnetic fields using instruments like gauss meters, and you can describe and explain them using numerous equations. Here are some of the basics:
  • Magnetic lines of force, or flux, are measured in Webers (Wb). In electromagnetic systems, the flux relates to the current.
  • A field's strength, or the density of the flux, is measured in Tesla (T) or gauss (G). One Tesla is equal to 10,000 gauss. You can also measure the field strength in Webers per square meter. In equations, the symbol B represents field strength.
  • The field's magnitude is measured in amperes per meter or oersted. The symbol H represents it in equations.