Because the sauce is not in the camera, but in the software. I recommend the following article, if not even for reading, just to appreciate how much processing magic is going on: https://vas3k.com/blog/computational_photography/
Laptops have a decent amount of compute power available.
If you look at laptop webcams, they are much smaller(and thinner) and have way crappier optics than an iphone camera. And nowhere near the same amount of optics.
Look at this ancient iPhone 6 exploded camera view. Does it look like it's even close to laptop webcams? Let's not even go into the "huge" (in smartphone terms) lenses modern phones have.