The standard theory of black body radiation that I am familiar with derive the Planck's law assuming first that we deal with a box in which the photon gas is contained. The box has a small hole in it so the light cannot escape once fallen into it - this realizes the 100% absorption property. However, the Sun or even other objects from our daily life are much more complex than that simple model and seem very distant from it. Nevertheless, the emission spectrum is well described by the same, universal Planck's law. Why? Can one derive that universal law using other model, with a different mechanism of absorption?
EDIT: Let me state my question in different, perhaps more clear way. There is nothing surprising for me in the fact that for example spectrum of the Sun do not fully agree with Planck's law, that is a typical situation for physics. When we model some physical system we always make idealizations, but in the case of black body theory the model of cavity with a hole is very simple and in microscopic sense totally different from for example stars. Without experimental verification I would not see much rational reasons for such a model to apply to more complex systems with different mechanism of absorption. But it apllies, not fully of course but it seems like photons inside a box reflect somehow thermodynamic properties of Sun - that is puzzling for me. We do not have a model of radiation of stars, we have a model for radiation of cavity with a hole, which is somehow valid for stars as well.