A magnet generates a magnetic field with a direction from North to South, which influences nearby ferromagnetic materials like iron. When iron approaches a magnet, its internal structure, composed of tiny magnetic domains, aligns with the external magnetic field, resulting in attraction from both sides. This alignment occurs regardless of the iron's orientation, as the domains rearrange to match the magnet's poles. If the external magnetic field is reversed, the domains in the iron also flip, maintaining attraction. This behavior highlights the unique properties of ferromagnetic materials.