JPEG compression quality is not the main limiting factor for the images coming out of camera. Also, it could well be possible to store sparse data to JPEG files - i.e. saving absent channel values as
0 - and make it comparable to RAW file size or less than that.
Following aspects are the reason for using RAW files:
- the image which camera gets from the sensor should suffer colour conversion to appear fine. Saving non-manipulated sensor image data to 8 bit files reduces the quality of colour conversion (which is not well-defined for all purposes), and if the manipulated data is saved to 8bit files, changing the colour conversion (for another puepose) will happen with additional loss
- cameras make unoptimal choices in many situations and one of the answers to the questions which you linked illustrates that exhaustively. Whether it is done on purpose or because of perfomance considerations is another question
- additionally, JPEG is considered an end-user image ready for exposure, and none of cameras which I know of treats it differently. This has it's own consequences such as sharpening and noise reduction which destroys image data. Also, it is assumed that white point of an image (i.e. the colour of the brightest tone) should be close to D65 (daylight 6500K) or somewhat like that for most modern applications, and image sensors have very different white point. Images from sensor loose additional information upon being converted to popular whitepoints which could be used in highlight recovery process. Cameras also increase contrast and it means that darker parts of images have less details even after correction.
Cameras are far from ideal and every image made with digital camera you see anywhere is a product of bunch of compromises. People tend to prefer different compromises.
There is a lossy 8bit JPEG compression supported in DNG file format which does not destroy images but it is prone to the reduction of colour conversion accuracy. You may use DNG Converter with lossy compression turned on to see how it affects your images, I found it to be acceptable for many applications. This happens so because
- the 12/14 bits of digital cameras denote the quantity of linear information, and 8 bit encoded images are almost exclusively gamma-encoded. What it means that difference between
16383 (the biggest 14 bit number) and
16242 is roughly as informative as difference between
255 (the biggest 8 bit number) and
254 and both are about minimally perceptible by human (unless the image is manipulated)
- even more than that, there is sensor noise of similar magnitude present in sensor output of most of recent cameras at ISO settings higher than ISO200 or so which deflates the importance of additional tonal values
- with the growth of resolution the colour depth importance is deflated. An image having resolution 2000x2000 and depth 4 bit may be rendered equally to the image having resolution 1000x1000 and depth 8 bit (if the 4 bit image was dithered. Sensor noise plays this role in camera images). Modern cameras have a surplus of colour depth in relation to their resolution for vast majority of applications and some part of colour depth may be wasted without huge quality loss.
Nikon was using 9 or 10 bit encoding for lossy versions of NEF files for long time already because it is not what decides on final image quality.
As long as raster image editing is concerned, JPEG introduces noise (non-existent details) upon each opening/saving of image. In this case one should use any image format which does not do it and supports needed bit depth. Those are: PNG, JPEG2000, TIFF, PSD, WebP and many others. Ideally you should edit images non-destructively using smart objects and layers.