Recent vortex images in periodic pinning arrays have revealed the formation of degenerate commensurate domains separated by domain walls near rational fractional filling. This phenomenon was entirely unanticipated since, in stark contrast to ferromagnetic materials, the energies and magnetisation of different domains are identical, and the driving force for domain formation and estimation of typical domain sizes has, until now, remained an unsolved problem. We use high-resolution scanning Hall probe microscopy to show that domain formation is driven by the efficient incorporation of mismatched excess vortices/vacancies at the corners of domain walls. Molecular dynamics simulations with a generic pinning potential reveal that domains are only formed when vortex-vortex interactions are long range. A semi-quantitative model of domain formation further discloses how domain sizes depend on both the pinning array period and effective penetration depth.