How does the concept of a "black body" make any sense? In my introductory chemistry class, we are learning about the basics of quantum mechanics. We were introduced to the concept of emission and absorption spectra. Our textbook describes how electrons can only exist at certain energy levels, and the packets of energy absorbed and emitted as they transition between these levels give rise to absorption and emission spectra. 
The book then goes on to describe a black body as a hypothetical object that can absorb and emit at all wavelengths. I understand that this is only a hypothetical object, but how does that even make sense if electrons can only exist at certain energy levels? Furthermore, the book immediately goes on to describe things such as the Stefan-Boltzmann law and Wien's law and all kinds of graphs of how temperature and intensity and wavelength of a black body relate to each other. But if a black body is theoretical, how do we even know these relations?
I am just completely confused about the entire concept of a black body.
 A: Your confusion is perhaps because of the term "theoretical object". It has nothing to do with the continuous or discrete natures of the energy levels; it just means that a black body has no reflection. [In reality, any body reflects some part of radiation on its surface.] An object of soot can be an approximation for a black body. Think of a black body as a chamber that contains thermal radiation (much as a gas). [You do not need to think in terms of electrons' energy levels in the object. In fact, a realisation of black bodies is a chamber with very small hole for radiation to come in.]
Now the question is: the energy level of the radiation in the chamber is continuous or discrete? It is rather very close to continuous because the chamber is rather big, as Wolphram Jonny commented. However an absolute continuous energy spectrum of the object leads to the divergence of the total energy because of short waves (ultra-violet divergence). This led to Planck's hypothesis about the discrete nature of the energy spectrum, which founded quantum mechanics. 
This is how quantum mechanics is introduced in some old textbooks. However I find it rather confusing following the historical development (physicists were confused themselves during the time). If you also find it confusing, you may want to try Sakurai's Modern Quantum Mechanics.
A: The black body in thermodynamics is an abstraction, like point mass in mechanics. It can be approximated but never realised perfectly.
For sake of simplicity we get rid of reflection (colour) and other material detail, and study a hypothetical body that absorbs and emits at all wavelengths. This will make all related calculations easier.
Furthermore, there are much more kinds of mechanisms behind emission and absorption than electron transitions. There are phonon excitations (infrared and microwave range), ionization (UV range) etc. The concept of the black body will help you to forget about all this detail.
Planck showed that if electromagnetic radiation was emitted and absorbed in quanta (following a certain rule), then the calculated black body spectrum fits  the measured one (extrapolated from laboratory experiments). His deduction was purely a statistical one, he made no assumptions on the specific nature of interaction between radiation and material. So even if there were no orbitals or even atoms his result would still be valid, provided that radiation was quantised of course.
A: A blackbody is something that is in thermal equilibrium and absorbs all radiation incident upon it. It is a theoretical ideal, but it can be quite frequently approached in nature. A hypothetical material that could only absorb light at extremely well defined, discrete frequencies, but was otherwise transparent or reflective could not radiate as a blackbody.
The usual "model" of a blackbody is to take a large container, place it in an even larger heat bath which ensures it stays at a certain temperature  and then open up a small hole in the side. Any radiation incident upon the hole will disappear inside the cavity with a negligible chance of bouncing around inside and re-emerging from the hole. 
But suppose we were to make the interior of the cavity out of a material that would only absorb light at a particular frequency corresponding to the transition between two energy levels in an atom. At all other frequencies the light is scattered (assuming for the purposes of our thought experiment, that the walls of the cavity are not transparent!) and would bounce around inside the cavity until it eventually found the hole and re-emerged. Now because we are are letting everything reach an equilibrium at some temperature determined by the heat bath there must be just as many light emission events as light absorption events, so that the ratio of the population of atoms in level 2 to those in level 1 remains constant and is equal to the relative populations you would expect at that temperature.
It turns out that in order to achieve this detailed balance, the source function (the ratio of emission to absorption coefficients) has to equal the Planck blackbody function at that temperature. That means the light emerging from the hole will be a blackbody at the frequency corresponding to the transition, but cannot be a blackbody at all frequencies. For example, if you fired monochromatic light into the cavity at a frequency that could not be absorbed, then eventually you would get just at much monochromatic light coming out of the hole - which is clearly not a blackbody.
In real materials, the question is - is there enough probability that some sort of absorption can take place at all frequencies? The key issue: is there sufficient probability of absorption so that a photon at that frequency has little  probability of making it back out through the hole? If so, then the absorption and emission processes will come into balance at that frequency such that the radiation at that frequency in the cavity is equal to the blackbody function at that temperature. If that is true at all frequencies then the radiation will have a blackbody spectrum.
Given that in real materials/gases, the energy levels are broadened by various processes, there is motion that causes doppler broadening, there are other physical mechanisms besides bound-bound transitions (e.g. free-free absorption by inverse bremsstrahlung; bound-free photoionisation and so-on), it turns out that often there is enough chance of photons being absorbed and coming into equilibrium with the material, so that a blackbody is a decent approximation. On the other hand real situations don't have a "small hole" - therefore the Sun only approximates to a blackbody; in reality near the top of the photosphere photons are able to freely escape, so what we see is a spectrum composed of a mixture of blackbodies - each frequency has its own blackbody temperature corresponding to the depth from which photons were able to escape. The more absorption there is at a particular frequency, the less deep into the Sun we can see and the lower the blackbody temperature.
A: This was the first question I asked my astrophysics mentor when I interned at Jet Propulsion Lab. It's a great question many people fail to ask for a long time.
When you have an individual atom, you get a distinct set of electron energy levels where you can excite a gas and have it jump back down an energy level. To first order this also works well to describe light observed from very weakly interacting states of matter (like gases). However things get trickier at the condensed states where interactions now matter.
Basically what happens here is that when you bring independent atoms close together, the wavefunctions for their electrons couple together, and you get energy level splitting, which basically means that two atoms which individually had 2 energy levels at $\epsilon_i $ you instead end up with two distinct energy levels at $\epsilon_{i+\delta} $ and $\epsilon_{i-\delta} $. This splitting occurs throughout the solid state and as N atoms enter the solid state it creates what is called an energy band, which resembles a continuum. The details are all material dependent so a nice baseline model would allow for us to ask essential questions and then study how the system in question deviates from the model. That's where the black body comes in. It assumes an equal density of states throughout the entire medium, with this "quantized" continuum framework that QM demands. 
Cultural enrichment:
The average energy of $\epsilon_{i+\delta}$ and $ \epsilon_{i-\delta} $ is not $\epsilon_{i} $ , but slightly less. You may know the case of two atoms in a subclass of this interaction as bonding and anti-bonding orbital. 
Enrichment 2:
You can use the statistical mechanics of a harmonic oscillator to model black body radiation.
A: Black body radiation was one of the first indications that electromagnetic energy is quantized.


As the temperature decreases, the peak of the black-body radiation curve moves to lower intensities and longer wavelengths. The black-body radiation graph is also compared with the classical model of Rayleigh and Jeans.

Classical electromagnetic theory which wanted the radiation emitted by a body at a specific temperature to be continuous had the so called ultraviolet catastrophe, the curve on the right. Data did not follow the classical distribution. Planck's law that required that electromagnetic radiation comes in packets called photons, (quanta of energy, E=h*nu,)  i.e. that the molecules would not radiate in the continuum but from specific levels, described the data as seen in experiments. This youtube video has an experiment and some curves at 6:46.
The theoretical curve is calculated assuming a metal cavity where these quanta bounced around and then one looked at a small hole to see what comes out. A black body is a body that contains the radiation coming from the molecular energy levels and radiates it from the surface . Real bodies have constants modifying the formula, but the basic idea holds.
You are correct, quantization is crucial to describe the spectrum theoretically, and the radiation comes from displacement of electrons to higher energy levels by the kinetic energy of the lattice ( the temperature is the average kinetic energy) and then the de-excitation by the release of a photon.

The book then goes on to describe a black body as a hypothetical object that can absorb and emit at all wavelengths.  I understand that this is only a hypothetical object, but how does that even make sense if electrons can only exist at certain energy levels?

A mole of matter has ~10^23 atoms/molecules. In a lattice this is still an enormous number of coupled particles, each with vibrational and rotational levels that contribute to the temperature by their kinetic energy. Each individual transition is quantized, the kick a molecule gets from the lattice and an electron goes to a higher energy level, and then decays back , all are quantized at an individual electron level. The statement "can absorb and emit at all wavelengths" covers this great multiplicity of energy levels and molecules, almost a continuum because of the great number of photons from a great number of levels . If it could do that classically ( as the classical black body had the same supposition) it would give the discrepancy with the data , the ultraviolet catastrophy.

Furthermore, the book immediately goes on to describe things such as the Stefan-Boltzmann law and Wien's law and all kinds of graphs of how temperature and intensity and wavelength of a black body relate to each other. But if a black body is theoretical, how do we even know these relations?

The black body theoretical formula is validated by experiments. The same is true by all the further formulae which use as basis the black body radiation,  they are validated by experimental data. It is the way physics progresses. Theoretical models are proposed, are checked against the data and if in agreement, the model is validated and is useful for applications. The relations are derived by using physics relations/equations as applied to the problem. They are then checked against the data for validation.  All these laws and formulae have been checked against data successfully  and that is why they are used in the appropriate situations.
