Equilibrium distributions of particles (Maxwell, Boltzmann, Saha) are achieved by the particle collisions. On the other hand, photons do not interact with each other. From the introductory course in the theory of radiative transfer in astrophysics, I learned that the equilibrium distribution of radiation is obtained through the interactions of photons with atoms (consecutive absorptions and emissions) in an isolated system at a constant temperature (Planck's distribution for black-body radiation). These absorptions and emissions are actually true or thermal absorptions/emissions (inelastic collisions of photons with matter) in which there is a conversion of electromagnetic energy into the internal energy of the gas (plasma) and vice versa (see the book of Mihalas: Stellar Atmospheres). With the help of these processes, a local equilibrium is established between the radiation field and the state of the gas.
If I understood that correctly, then the following is not clear to me. In the book 'Atomic Astrophysics and Spectroscopy' by Pradhan and Nahar (2011, Cambridge University Press) is written:
At the earliest times, radiation and matter were coupled in the sense that photons scatter from free matter particles via Thomson or Compton scattering, and have short mean free paths. Since all radiation energy was thus ‘trapped’, the Universe was in a radiation-dominated state and essentially opaque. The conditions would have been as in an ideal black body characterized by a radiation temperature and a Planck distribution. That would correspond to an extremely hot radiation background, the forerunner of the much cooler present-day cosmic microwave background (CMB).
I don't understand here what are the actual physical processes of the interaction of photons and matter that are responsible for the establishment of the Planck distribution. Thompson/Compton scattering? If so, I don't understand how scattering processes can be responsible for the establishment of equilibrium distribution of radiation. Am I missing something?