Why are domains formed as separate units? I was reading about exchange coupling and domain formation in ferromagnetic materials. As far as I can understand, some of the dipoles in the ferromagnetic material align themselves in a group called a domain, and several such domains are formed with enough randomness to prevent magnetisation of the material. 
But I'm slightly confused in the part that the book assumes domains formed as pockets of dipoles in one direction, separated by a boundary and all the dipoles in a domain point in the same direction. I am unable to imagine intuitively why the phenomenon suddenly stops at the boundary between two domains. Shouldn't dipoles of one domain affect those of other domains? 

 A: The interaction of atoms in a ferromagnet is typically modeled as an exchange interaction. The exchange interaction is related to the Pauli exclusion principle, which prohibits electron clouds of neighboring atoms from overlapping when the unpaired electron spins are aligned. This prohibition decreases the electrostatic potential energy of the spin-aligned configuration relative to the spin-antialigned configuration (in which the electron clouds do overlap), making the spin-aligned configuration more energetically favorable.
As you can see, in the exchange interaction, each atom is only affected by its nearest neighbors. So it doesn't know, and can't affect, the spin orientation of the atoms in other domains. There are only a few atoms in the material that do experience any kind of misalignment with their neighbors. These are the atoms near the magnetic domain walls. As the domain wall is crossed, the orientation of the local spin rotates smoothly from the alignment of one domain to the alignment of the other. So the phenomenon doesn't suddenly stop at the boundaries; it's a very gradual transition on the microscopic scale. See the following illustration, where A and C are domains and B is a domain wall:
