GaN is an important wide-gap semiconductor that is an essential component in blue light emitting diodes. Many experimental observations, both optical and electronic, such as intrinsic n-type conductivity and a range of luminescence bands found in a majority of samples, have been attributed to different defect structures in the material using first-principles calculations, typically employing the periodic supercell technique to model defects. The attribution often depends on the level of density functional theory applied, with little consistency across a broad range of studies. To overcome the problems inherent in plane-wave-based defect calculations, we employ the hybrid quantum mechanical/molecular mechanical embedded cluster approach, whose main advantages are access to a common reference energy, lack of image-charge interactions and a detailed description of polarisation due to local charges in a crystal, to compute formation and ionisation energies of point defects and defect complexes in GaN. Furthermore, we calculate equilibrium Fermi energies and carrier and defect concentrations at different temperatures. Our results account for the native n-type nature of GaN as well as suggest plausible explanations for observed deep level transient spectroscopy signatures, while we discuss the unresolved problem of the source of hole carriers in p-type GaN. Moreover, by taking into account the balance between carriers bound in compact and diffuse states and considering different absorption and emission processes involving point defects and defect complexes, we explain various photoluminescence peaks observed routinely in doped and nominally undoped samples. In particular, we attribute the 3.46 eV and 3.26 eV ultraviolet emission peaks to nitrogen vacancies binding compact and diffuse holes respectively, and describe the processes related to gallium vacancies that result in observed yellow luminescence. We demonstrate that the competition between these differently bound carrier states is key to understanding the luminescence properties of GaN, a point that has implications for other wide gap semiconductors, including oxides.