Why do naturally occurring ferromagnetic materials contain a large number of domains? Why do naturally occurring ferromagnetic materials (e.g. a piece of iron) contain a large number of domains rather than a single domain, and hence, carry no net magnetization? So the question is basically why do domains form. 
 A: There exist several kinds of interactions in a ferromagnetic material. The strongest one is the exchange interaction which tends to align atomic magnetic moments in the same direction and is responsible of ferromagnetism. It is a purely quantum phenomena. The exchange interaction between two atoms depends on the overlap of their wavefunctions. Therefore, it decays usually exponentially fast with the distance between the two atoms and is often already negligeable between second nearest-neighboring atoms in a crystal. 
Besides exchange interaction, you probably know that a magnetic moment, say $\vec m_1$ at the point $\vec r_1$, creates a magnetic field
  $$\vec B(\vec r_2)={\mu_0\over 4\pi}\left[{(\vec m_1.\vec r_{12})\vec r_{12}\over r_{12}^5}-{\vec m_1\over  r_{12}^3}\right]$$
so that a second magnetic moment $\vec m_2$ at $\vec r_2$ feels a torque associated to the potential energy $-\vec m_2.\vec B(\vec r_2)$. This is the so-called dipolar interaction. It tends to align two magnetic moments in the opposite direction. It is weaker than the exchange interaction but falls as the third power of the distance. This dipolar interaction stabilizes magnetic configurations with magnetic domains in different orientations.
A: There is energy associated with an external magnetic field, so the lowest energy is when external fields are small. For example, two bar magnets will align in opposite directions next to each other. This is the magnetic dipolar interaction.
There is also an energy associated with domain walls (neighbouring spins are not quite parallel). The balance between the two influences the size of the domains.
