I am puzzled about the formation of blackbody emission (Planck's law). Specifically, we know that such things like incandescent lamps, an electric arc in a gas at high pressure etc. produce a nearly blackbody spectrum of corresponding temperature. Does this mean that in these cases a nearly equilibrium state between radiation and matter is set up? Or how do you explain why the spectra are close to that of a cavity?