An important thing to understand is that everything emits electromagnetic radiation.
First, it is important to note that everything has a temperature > 0 K. That means that there are particles moving and colliding at non-zero speeds. When two particles collide, each of their charges accelerates. This alters the electric field around them and propagates outward.
Why charge-acceleration emits electromagnetic radiation
This shows a particle which has accelerated to the right. At constant acceleration, it had a normal electric field. Once it was "bumped", it slightly moved the electric field, and the electric field lines, which can't break, have to switch from their old configuration to their new configuration.
So, the image shows the new electric field lines on the inside, and the old lines on the outside. Between the circles, it shows the electric field lines adjusting. This propagates out infinitely, and that's why an electric field is emitted. (I got this answer from here)
So, as the velocity of the particles increases, the intensity of the electromagnetic wave increases. Note that an increase in velocity means an increase in temperature, so hotter objects emit more intense electromagnetic waves.
We said that hotter objects emit more intense electromagnetic waves, but they also peak at a lower wavelength. For example, if you heat something up to 3000 K (lightbulb), it will appear red, because that is the most prominent wavelength. If you heat something up to 5700 K (sun's temperature), it will appear white, because it peaks in the middle, green, so everything in the spectrum is visible. As something gets hotter, it moves into the blue spectrum.
Quick sidebar- Why is it a continuous spectrum?
Temperature just means average kinetic energy, so it is composed of many particles moving at different velocities, making different emissions at their own wavelengths and intensities. Therefore, there is a wide spectrum of emissions.
This image gives the peak frequency as a function of temperature (Kelvin). This is very accurate among small wavelengths, but isn't as accurate among larger wavelengths.
Rayleigh-Jeans Law approaches infinity as the wavelength approaches 0. That cannot be. Also, I'm pretty sure this picture isn't accurate, but the general idea is correct. The Rayleigh-Jeans Law and Wien's Law diverged around the ultraviolet zone. Planck solved this with his own equation to describe electromagnetic radiation. This is complicated, and I won't write, but what is commonly known is the Planck relation.
E = hf
This means that the energy of an electron equals h, a constant, times its frequency. This also meant that all energy was some integral multiple of this.
This just a definition. It may be out of order, but it is essential to understand.
A black body is an idealized concept. It doesn't actually exist, but many things are close. It absorbs all radiation. This is contrasted with a white body, which reflects everything. Anyway, what makes important is its radiation. Called black body radiation, it has a specific, calculable, spectrum and intensity which only depend on temperature. This makes calculations and theory really easy, so they are used to approximately real objects.