Atoms have electrons, which orbit them in clouds of probable positions called orbitals. Electrons have three quantum numbers, which define the orbital they are in. In addition, they also have a fourth quantum number called spin, which may have two values, up or down. According to Pauli principle, two electrons cannot be in the same state in the same time. Thus, only two electrons can be in the same orbital, those of opposing spin. Spin is a small magnetic momentum.
Now, you have iron, nickel and cobalt, which are ferromagnetic. These atoms have a 3D orbital that overlaps with the neighbouring atoms 3D orbital. Both atoms have one electron in the overlapping orbitals. According to Pauli principle, these two electrons cannot in same place in the same time if the directions of their spins are the same. Thus, the distance between the electrons with same spin is greater than that of electrons with opposing spins. Electrons are electrically charged and they both have same electric charge. Therefore, there is a repulsive force between two electrons. Thus, it is energetically favourable (system finds a state where it's energy is at minimum) for the two electrons to have same spin as it allows them to be farther apart from each other.
With the electron spins aligned to the same direction as that of the neighbours, the magnetic momentums of the atoms sum up to form a stronger magnetic field. Thus, iron, cobalt and nickel are always magnetically ordered(unless heated too much). In nature, iron, cobalt and nickel can have their magnetic regions ordered so, that the net magnetic field outside of the material is zero. However, the material can be magnetized, meaning that an external magnetic field can turn magnetic regions, as the position where the magnetic momentums are aligned with the external field is energetically favourable.