There are countless pages dedicated to this topic so I won’t rehash too much of that. One of reasons I choose to shoot RAW + JPEG is that I have the headroom to recover my errors when shooting, specifically metering. This photo was a complete accident, but illustrates this point quite well.
The first image is a JPEG pushed to +5 stops in Lightroom.
The second image is a DNG (RAW) file pushed to the same +5 stops in Lightroom.
Neither photo is usable, but it does highlight just how much information is thrown out when compressed into a JPEG. *The photo was taken with the Ricoh GR in AV priority and saved as JPEG + DNG.