How can a cavity with perfectly reflecting walls approximate a perfectly absorbing black body? I don't see why you can derive the black body spectrum from the mode density of the radiation inside a reflecting cavity. I do understand the mathematical side of the derivation and I know that an absorbing cavity with a small hole is the best approximation of a black body. But aren't the standing EM waves inside the cavity only there because the cavity is perfectly reflecting, determining the boundary condition of a vanishing field at the boundaries? How is this releated to a cavity with black, (perfectly) absorbing walls? Again, I do understand that the walls can't reflect all of the incoming waves, because there must be a possibility for the matter and EM waves to interact in order to establish the thermodynamic equilibrium, but then how can you look at standing waves inside the cavity, if it is not perfectly reflecting?
 A: 
"But aren't the standing EM waves inside the cavity only there because the cavity is perfectly reflecting, determining the boundary condition of a vanishing field at the boundaries?"

Yes, only a cavity with perfectly reflecting walls can support oscillating field with fixed nodal surfaces that is known as a standing EM wave. Such EM field oscillates harmonically with single frequency.
But the EM radiation surrounding a piece of matter in thermodynamic equilibrium - blackbody radiation - is a chaotic EM field that does not oscillate harmonically or with fixed nodes; it is not a standing wave.
Neither are the standing waves necessary mathematically to resolve the EM radiation into Fourier components and proceed with the derivation of the blackbody spectrum - it is sufficient to consider imaginary cuboid of empty space where equilibrium radiation is present and apply Fourier decomposition to the EM field in this cuboid; the Fourier components considered are then not necessarily standing waves.
With this in mind, one may pose the question, why do textbooks assume the blackbody radiation is enclosed in the perfectly reflecting cavity then? Why use an assumption that is not necessary for the derivation?
The perfectly reflecting walls are considered not because the perfect reflectivity or the possibility of standing waves are somehow important for the derivation of blackbody spectrum, but because they are necessary to make the system isolated with no radiation leaks. In practice, reflective walls increase the impact of interaction of radiation with the matter inside and make equilibration easier.
Kirchhoff proposed reflective cavity as a way to construct blackbody; reflective walls allow for multiple reflections of EM waves and multiply their interactions with the piece of matter inside the cavity. With transparent or strongly absorptive walls, the radiation produced or implanted inside would not interact with the matter inside cavity enough to change its spectrum to equilibrium; it would either escape or get absorbed in the walls before it could form equilibrium with matter inside.
Theoretically, perfectly reflecting walls of cavity is the only thing that can isolate the system thermally from the outside. Such walls allow us to think of the radiation as contained in a finite volume, as having constant energy and enable us to consider thermodynamic processes that happen to such radiation. With absorptive or transparent walls, the analysis would be much more complicated, because effect of real walls on the radiation is complex and the walls would become part of the system to be described.
Experimentally, some cavity is needed to contain the radiation so the latter can interact with matter inside and evolve into equilibrium. However, the cavities that early experimenters (Pringsheim, Lummer) could use were not perfectly reflecting - even mirror surface absorbs some parts of inbound radiation. As for the piece of matter to interact with the radiation, they chose to put it on the inner side of the walls, probably to get advantage of the large surface available and so help the process of transformation of radiation into the state of thermodynamic equilibrium. They used metallic and porcelain walls covered with lamp black (soot) and metal oxides. This inner part of the wall then played the role of matter considered to be inside the cavity in order to  interact with the EM radiation and enable the process of equilibration.

"How is this releated to a cavity with black, (perfectly) absorbing
  walls? Again, I do understand that the walls can't reflect all of the
  incoming waves, because there must be a possibility for the matter and EM waves to interact in order to establish the thermodynamic equilibrium, but then how can you look at standing waves inside the cavity, if it is not perfectly reflecting? "

The walls do not have to be perfectly absorbing; if there is matter inside the cavity, the blackbody radiation will establish itself even if the walls are perfectly reflecting. But in reality there is no such thing as perfectly reflecting wall, all walls absorb somewhat.
A: There is a derivation of Planck's formula from the energy given by the Boltzmann distribution. This distribution has to do with the statistical 

In statistical mechanics and mathematics, a Boltzmann distribution (also called Gibbs distribution1) is a probability distribution, probability measure, or frequency distribution of particles in a system over various possible states.

It describes the statistical  behavior of many particles, and the fact that the black body distribution can be derived from this ties the analogy of oscillators in a cavity, to molecules in matter. 

Simple Derivation of Planck’s Formula from the Boltzmann’s Distribution

In a sense this is logical because the individual molecules have vibrational and rotational degrees of freedom  which behave as oscillators, and define the temperature of a body. The reflection in the oven approximation does  not exist for massive bodies, and that is why power is lost according to the various formulas of black body radiation .The model holds only instantaneously, because massive bodies continuously radiate to space.
A: "I hope I understood the question well and it will help." Jimmy 
When radiation comes to the black body, we want everything to be absorbed. So the theory must contain Maxwell equation on the surface, of course. These say that tangent magnetic field of the incident light can (but doesn't have to, it depends on few more parameters) give a rise to surface current. But tangent electric field (the current has linear dependency on the electric field most of time) must be continuous, so there must be inertial electromagnetic field inside the body all the time. The only chance to null this field is by assuming no incident light, but then we wouldn't need the black body.
Edited: The waves inside the cavity are dependent on what is scattered outside. This should be clear from the next paragraph.
This means that in resonance-regime when field is vanishing on the surface, total reflection appears, as you claimed. But when all of incident power is absorbed, you get black body. This is the same effect that could be reached by limit $\sigma_s \to \infty$ when we have ideal conductor and it can take all of energy no matter what. For real conductors we must have special setups.
Something more 
Zel'dovich has shown that there are few regimes in rotating cylinder. When a condition $\omega < m\Omega$ is satysfied, energy can be extracted from the kinetics of the cylinder. On the other hand, when $\omega > m\Omega$ there are few frequencies when all of the incident power if absorbed by the surface. That is the "time" when we could call this behaving like the black body. 
Another example is standing sphere with radius $a$. There is possibility to null the scattered power, the condition for this is
\begin{equation}
1 = \sigma_s \mu_0 c a^2 j_\ell(ka) h^{(2)}_\ell(ka),
\end{equation}
where $j_\ell$ is a spherical Bessel function and $h^{(2)}_\ell$ spherical Hankel function of the second type. 


*

*$\omega$ is angular frequency of the incident wave, $m$ is its azimuth number and $\Omega$ is angular velocity of the cylinder (or other axially-symmetric body).

