>>3319061JPEG is pretty bad. I hope we replace it soon, though that obviously will be hard with the tons of existing software supporting it and not the better formats, never mind the [most strongly US] software patent hell and so on.
Some of the candidates are here, basically all are better than JPEG in just about all instances:
https://wyohknott.github.io/image-formats-comparison/The RAW formats currently in use may not be ideal either, but at least they don't fuck with images the way JPEG does.
Apart from that, it doesn't depend on these two. The higher-end cameras are primarily designed to enable shooting RAW, by people in teams who can engineer cameras. They're the people who really know better what they're doing.