Where the argument of RAW over JPG fails is, JPGs are not so inadequate that they can't produce a comparable image.
This warrants further exploration and explanation. Of course the camera JPEGs can be good enough to be acceptable for lots of people. They can be good enough to sell in many situations, and that's a good thing, but they are not comparable to final images hand processed from raw files. Why? The reasons are numerous and involve different aspects of the image processing task. One reason that all our cameras share is the engineering necessity to compromise. The engineering teams that design the camera JPEG processors are gifted and do amazing work but nonetheless they work with a gun to their heads and they can't do the impossible. They must at all times consider that the user will decide to press and hold down the shutter release. The camera then is expected to take a rapid fire sequence of photos. To do so the camera should be set to save JPEGs only. And to allow that rapid sequence to run at full speed for as long as possible the JPEG processing has to keep up. To do that the engineers compromise -- they have no choice. There's a lot that has to get done.
A reason this topic is complicated is because all the different engineering teams for all the different brand cameras don't all make the same compromises in the same way and so we get variability one brand and model camera to the next. With that understood let's take a look. One task that has to be accomplished is the demosaicing of the sensor CFA. That's a big job and there are numerous software algorithms available to accomplish it (different strengths/weaknesses and different processing speeds). No camera offers the user a choice of demosaicing algorithms -- you get what's in the camera period no discussion. I have that choice in some of the raw processing apps I use and it can make a difference. Here's a photo from a Fuji X-T2:
Demosaicing the CFA is a weakness for Fuji and so this doesn't necessarily apply to the same degree for all brand cameras, but they will have their own weaknesses. They all have to struggle with the same issue. In the photo above you see two 100% enlargements of the air conditioner grill and the outer wall. On your left is the Fuji JPEG and on the right is the raw file processed in DXO PL9. Fuji's demosaicing algorithm doesn't extract the same level of fine detail the you get from the PL9 demosaicing. You can't do anything with the Fuji camera settings to get it any better. I've already cranked up the Fuji sharpening -- it's as good as it gets and it's not comparable. Lenses? Yep lenses matter. I have a very nice 75mm Apo Summicron I use on my Fuji cameras. It's a very good lens and I like to see the wonderful fine detail it renders, but I'll never fully see that from a Fuji JPEG.
I can go on with this for pages and pages. Let's do another example. Another task the JPEG processor has to complete is applying lens corrections. Canon has a weakness there. Their in-camera lens corrections suck. Here's a photo from a Canon G7xmkII compact. When I bought the camera I read reviews and a common complaint was that the lens went soft in the corners. It doesn't actually; it's the sucky lens corrections and the reviewers were looking at camera JPEGs.
Again in the two 100% insets the left one is the camera JPEG and the right one is the raw processed in DXO PL9. I've seen this with a number of Canon's zoom lenses on their DSLRs as well. It's almost like it becomes a whole different lens and camera when you process a raw file and do it right. Again the engineering teams actually do an amazing job given the requirement. What you see in the above example is the difference better tools make.
Which camera brand makes the best JPEGs? In my experience that's Nikon. I haven't seen them all but I've seen far more than most of us here. My years spent in the classroom gave me a unique opportunity to examine and handle a very large sample of what's been available. So let's do one more and look at how bad Nikon JPEGs can be. This is a weakness all the brands share together; noise processing. For this one I just took a photo with a Nikon Z7 and raised the ISO to 6400 -- not sky high for a FF camera these days.
The three 100% insets are from your left the noise unfiltered then the in-camera noise filtering set to Normal (on High it finds the last little bit of detail left and just mushes it away) and on your right noise filtered in DXO PL9. In the past decade and a half we've made real significant advances in noise processing. Unfortunately it's all very processor intensive and there's no way it can be placed in our cameras without it shutting down the camera's ability to shoot a rapid sequence.
Again I could go on for pages. The above three examples just scratch the surface and those are all things we have no control over whatsoever. None of those things can be altered in camera; at best you can turn the noise filtering off. We haven't even started on the things that we do have some control over. When we get to the picture control items it's good that the cameras give us some options and it's good that those options have been increasing and have gotten better, but compared with what's available in a raw processor they're not comparable -- they're still crude or they're not there. Next time you take a landscape and save a camera JPEG apply sharpening to the foreground and withhold it from the sky. My teacher taught me that it's a very rare photo that doesn't benefit from a corner burn down as a final step. Go to your camera and turn on the apply a vignette option. Some cameras do have it now (Sony) but not many and in those that do it's not very adjustable. In your next landscape saved as a camera JPEG apply a mask and increase the contrast of the clouds in the sky. And so that get's us to the next topic -- editing the JPEGs. Yes, you can do it but not nearly or comparably as well as you can edit a raw file.