The reason that you can get more dynamic range out of RAW files and correct exposure better is that the camera generally records 12 bits of data for each photo site whereas a jpg has been reduced to 8 bit color.
Actually, both a RAW file and a JPG file are compressed. The difference that I think you are driving at is that a JPG file uses a form of "lossy" compression whereas a RAW file uses "lossless" compression. A lossy compression algorythm throws away information that it determines to be less important. A lossless compression algorythm is one in which the uncompressed data is absolutely identical to the input data.
The fact that JPG is a lossy format makes it important that you minimize the number of times you open, edit, and save a JPG file. Every time you do so, the compression process loses more data. To see what I mean, open any JPG photo, make a minor edit, save it, and close it. Repeat this process through a few iterations. Then compare the original with the multi-edited version and you'll see a significant loss of detail and higher levels of noise/artifacts.
A RAW file contains all of the data captured by the camera, whereas a jpg file has been compressed, which necessarily causes some of the data to be lost.
Sort of, but not quite. As has been said, in RAW you get 12 bits of data (4096 different possible values) for each of the three colors whereas in JPG you only get 8 bits of data (256 possible values). The JPG can still cover the same dynamic range with 8 bits that the RAW file covered with 12 bits, however, if it does so, the differences between each color value are necessarily larger.
For example, if the RAW file had every possible value of blue from none at all to the brightest possible, it would have 4096 different shades of blue represented. A JPG version could still go from no blue at all to the brightest possible blue, but it would have to do it with only 256 different shades. The picture covers the same dynamic range, but the differences between the shades of blue are larger.
So when would that matter? It very rarely does straight out of the camera. However, if you start editing the photo, doing things like changing the brightness or contrast, you may find that you need those subtle differences that were present in the RAW file but not in the JPG.
With RAW you can change the white balance any way you want after you take the picture. You aren't stuck with the balance.
You aren't really stuck with the white balance either way. In both photos, you've captured a range of color values for every picture. With the JPG file, you've also adjusted that range of colors to account for an expected color cast. If the process that converted to JPG got the white balance wrong, you can still adjust it. The problem with doing this on a JPG is that you've already lost a lot of the original information when you converted the file. It may not be possible to adjust the white balance very much without making the picture look bad. The same thing can happen with a RAW file, but because you've still got a lot more information, you've got much more room for error.