The occurrence of pair production within the detector depends on gamma energy and detector material. The occurrence of escape peaks in addition to a given full-energy peak depends on detector geometry and sample geometry.
If the gamma energy is large enough to make pair production relevant, the photon may disappear and be replaced by an electron and a positron. The electron and positron may travel a few millimetres before losing their kinetic energy to the absorbing medium. When its kinetic energy becomes low, the positron may combine with an electron in the absorbing medium. Then both disappear and are replaced by two annihilation photons. If one annihilation photon escapes without interaction within the detector, a single escape peak appears in the spectrum at an energy of 0.511 MeV below the full-energy peak. If both annihilation photons escape, a double escape peak appears at an energy of 1.02 MeV below the full-energy peak.
For a (theoretical) very large detector, all secondary radiations, including annihilation photons and Compton-scattered gamma rays, interact within the detector. Because nothing escapes from the detector, the total energy is simply the original gamma energy. The detector response is the same as if the original photon had undergone a single photoelectric absorption. The spectrum shows only the full-energy peak but no escape peaks.
For a (theoretical) very small detector (small compared with the mean free path of the secondary gamma radiation), virtually all annihilation photons escape from the detector. In addition to the full-energy peak, the spectrum shows a double escape peak but no single escape peak.
For a (real) intermediate-size detector, the effects of large and small detectors are combined with effects related to partial recovery of secondary gamma radiation. In addition to the full-energy peak and the double escape peak, a single escape peak frequently occurs, if one annihilation photon escapes but the other is totally absorbed. Furthermore, other possibilities exist in which one or both of the annihilation photons are partially converted through Compton scattering and the scattered photon subsequently escapes. Such events result in a broad continuum in the spectrum between the full-energy peak and the double escape peak.