However, and what I thought might be a 'gotcha' is that if you need to recover detail from shadows, jpg has more detail preserved. I imagine someone wiser will tell me otherwise.
I certainly wouldn't claim to be any wiser, but I'll have a go at telling you otherwise.
The camera initially shoots a raw image - there is not much else it can do - and then does loads of processing in camera to create the JPEG. I'm not sure how the in camera processing (which is constrained by the needs of limited processing power and very little time) is able to retrieve more shadow detail from the raw data than much more powerful software running on much more powerful machines and taking considerably longer to get the job done.
The example I posted earlier of shadow "recovery" from the shaded area of that wedding pic demonstrates that the raw file is more information rich in the shadows than the JPEG. That was from my 1D3.
Here's a shot taken with my 5D2 using raw+JPEG with standard picture style and NR disabled. It was exposed using evaluative metering and autoexposure. Here is the whole scene without edits....
If we look closer we see a little highlight clipping in the JPEG version. In all honesty this is a pretty good attempt by the camera at a good exposure. Interestingly there are no clipped blacks/shadows at all. That must mean we've lost no shadow detail at all. Awesome stuff!...
Here's a 100% crop of the shadow area with no edits....
Even at this dim level I can see that the raw version has more detail. It looks sharper and better defined. There is more contrast in the shadows.
Here is the result of an aggressive push to the shadow region using Lightroom's fill slider. This adjustment is well over the top in terms of producing an aesthetically pleasing result, but the purpose is to show what detail is buried there in the shadows, not to make a finished image...
Just to add further to the picture (Hah! Hah!) here is how the raw file looks when opened in DPP and pushed to a roughly equal amount, with no other adjustment to setting such as sharpening or NR. It's clear to me that DPP is also able to extract a far better image from the raw data than the JPEG pumped out by the camera.....
There's no trickery here. Quite simply the JPEG SOOC looks dreadful. In this example I don't think anyone could make the claim that in camera JPEG processing has the edge over raw. This result has been repeated with my 30D, 1D3 and 5D2. It doesn't matter whether DPP is used as the JPEG engine or the camera itself. The JPEG files do not have the information content that the raw files do. Raw does better in the highlights, better in the shadows.
Whether anyone is troubled by the vanishing data is a completely different matter. For some it may not be a problem. For others it might.