I am studying blackbody radiation and modelling a cavity as a blackbody. However, I am encountering a number of confusions in this description:

1. Many textbooks mention that the cavity consists of metallic walls that act as perfect reflectors. Light entering through the hole, after multiple reflections, get absorbed. However, if the cavity walls are perfectly reflecting, how is the radiation getting absorbed by the walls?
2. For studying the radiation emitted by the blackbody, the textbooks model the radiation inside (emitted by walls due to heating) as standing waves. But how are standing waves being emitted by the cavity? Because standing waves are supposed to be confined inside.

Can anyone please explain in simple terms?

Perfectly reflecting cavity is not a blackbody. However, if inside the cavity there is some piece of absorbing matter, then a small hole in the cavity will behave as black body. The piece of matter can be arbitrarily small, and some sources neglect to mention it.

Perfectly reflecting cavity is a superfluous concept in derivations of the Planck spectral function. All that is needed is the Fourier decomposition of EM field, which can be done even for imaginary cuboid in space, no special walls are needed.

The reflecting walls are carried on in expositions on this topic probably because that is one sure way, theoretically, to keep radiation inside the cavity long enough so that it can come to thermodynamic equilibrium with matter inside. But it is not needed for the derivation itself; what is needed is the assumption that equilibrium statistical physics applies.

In practice, blackbody radiation was prepared and studied in cavities that are metallic, but are covered with black oxides on its internal faces. The black oxides are there to absorb great part of incoming radiation and thus make the radiation interact with matter and facilitate establishing of thermodynamic equilibrium between radiation and matter. The usual derivation of the Planck function does not take into account this absorbing layer, because it is not needed for the derivation.

Textbooks sometimes mention standing waves, but don't imagine radiation inside to actually be a standing wave; it is random fluctuating radiation, which can be also thought of as superposition of travelling waves. "Standing waves" is here just to describe the Fourier decomposition of the EM field inside in case the walls are perfectly reflecting; then electric field vanishes on the walls, and one can re-express the Fourier sum over travelling waves as sum over standing waves.

Here is a more correct and hopefully easier way to visualize the process.