Often it's the lens that results in poor quality images. You can get a RPi sensor with CS mount and add your own lens of your choosing. It's been a huge upgrade in quality and is relatively easy to do.
There is also a lot of "secret sauce" that Apple and others do to the raw image data that comes off the sensor. I don't doubt much better quality could be eked out of the RPi cameras if there was a determined effort to do so.