  Optically detected magnetic resonance (ODMR) has been observed from emitters
in hexagonal boron nitride across a broad range of wavelengths, but so far an
understanding of their microscopic structure and the physical origin of ODMR
has been lacking. Here we perform comprehensive measurements and modelling of
the spin-resolved photodynamics of ensembles and single emitters, and uncover a
universal model that accounts, and provides an intuitive physical explanation,
for all key experimental features. The model assumes a pair of nearby point
defects -- a primary optically active defect and a secondary defect. Charge
transfer between the two defects creates a metastable weakly coupled spin pair
with ODMR naturally arising from selection rules. Our optical-spin defect pair
(OSDP) model resolves several previously open questions including the
asymmetric envelope of the Rabi oscillations, the large variability in ODMR
contrast amplitude and sign, and the wide spread in emission wavelength. It may
also explain similar phenomena observed in other wide bandgap semiconductors
such as GaN. The presented framework will be instrumental in guiding future
theoretical and experimental efforts to study and engineer solid-state spin
pairs and unlock their potential for quantum technology applications.
