A closer look at Mean free path
The mean free path is the average distance a particle or photon travels before a specified interaction.
It depends on the density of targets and the probability of the interaction. It can vary enormously across a star.
Deep inside the Sun, photons interact repeatedly over short distances. Near the photosphere, a photon has a much better chance of escaping into space.
Want to learn more about Mean free path? Mean free path on Wikipedia.

