A magnet produces a magnetic field that pulls on ferromagnetic materials like iron via attraction or repulsion. Magnetism originates from the orbital and spin motions of electrons, which produce magnetic moments. When a substance is placed in an external magnetic field, it exhibits different magnetic behaviors classified as diamagnetism, paramagnetism, ferromagnetism, or antiferromagnetism based on the sign and magnitude of susceptibility and dependence on field strength and temperature. Diamagnetic materials are repelled by a magnetic field while paramagnetic materials are attracted into a field. Ferromagnetism and antiferromagnetism arise from interactions between atomic spins in a crystal lattice.