a jpeg file is 8 bit - this means each of the 3 color channels can only store 2^8 or 256 possible values for each pixel
a RAW file is generally 12-bit - this means each of the 3 color channels can only store 2^12 or 4096 possible values for each pixel and thus allow for much more tonality and is much more forgiving with subsequent image manipulation
so this is the reason you should shoot in RAW mode if you want the best quality shots
BUT, there is more - the files are structured so that 50% of the data range will be devoted to the brightest 1 stop, 25% to the next brightest 1 stop, and so on down the brightness scale
this means is you expose as per your camera, you are probably going to miss out on the brightest stop and perhaps even the 2nd brightest stop, meaning your data in your image will be only using less than 25-50% pof the possible data range!
exposing to the right aims to resolve this - as long as your bright non-specular highlights do not get blown out by too much over-exposure