I read from a textbook that a dense, hot and opaque body produces black body radiation, for example the heated filament of an incandescent light bulb.
Why is it so?
The explanation given is
if a body is opaque, then the protons, neutrons, electrons, and photons which it contains frequently interact, and attain thermal equilibrium.
But a blackbody is supposed to absorb all radiation, and a body being opaque just means that it does not transmit radiation through it. It can still reflect radiation.
It also seems to suggest that photons inside the body is trapped and thus interact to reach thermal equilibrium. If they are trapped, how do they escape to produce radiation?