Why is an emission spectrum dependent on the chemical composition of the body's material, but the black body spectrum is independent of the material and only based on the body's temperature? Aren't both spectrums caused by photons being emitted due to electrons transitioning between states?
The black body curve comes from an idealized model, which forced quantization of the electromagnetic energy so as to avoid ultraviolet catastrophe. Real bodies' radiation approximates it but the effect of discreteness of the spectra cannot be avoided.The energy radiated by a mass with a specific composition in elements can be approximated by the idealized cavity with electromagnetic waves, but elements have different spectra, following quantum mechanical probabilities, and differing response to temperatures also as far as phase diagrams. This means that, because of the spectral nature, the continuum of the black body curve will differ due to the energy levels, and the possible different behavior of differing elements at the same temperature will also be distorted from the ideal curve.
See the sun for example, fitted with a black body, but even for those high temperatures there are deviations from the black body model due to the specific composition of the sun. I suppose the deviations at high energy photons are due to the different way the layers are composing it . On the infrared side, where atomic spectra and molecular ones are practically continuous, the fit is better.
The best fit to the black body curve is the cosmic microwave background:
Graph of cosmic microwave background spectrum measured by the FIRAS instrument on the COBE, the most precisely measured black body spectrum in nature. The error bars are too small to be seen even in an enlarged image, and it is impossible to distinguish the observed data from the theoretical curve.
These are photons from when the universe was 380.000 years old and the photons decoupled and did not interact until finding the CMB detectors.
Fitting radiation curves with the black body formula is a useful first order description of the radiation. After all a lot of the spectrum is in the infrared and for large bodies the discrimination of the molecular spectra is below the sensitivity of the instruments recording the radiation. The curve gives a useful envelope.