I think a lot of what you see, given modern laptops, isn't so much low-quality webcam issues as it is poor lighting issues, whether because of low light levels, backlighting, or a combination of the two.
It's a little of both. A larger lens gathers more light from a given scene and thus doesn't need to crank the sensor gain as high (which adds both luminance and color noise) for a given exposure value. Even a fairly basic webcam will have a larger lens than the camera built into a laptop's lid.
So, while my laptop from 2016 almost certainly has a better sensor than my webcam that hit the market in 2013, the 2013 webcam still looks better, because it can do more with the same amount of light - for example, I'm facing three windows in full sun right now, and the laptop video still manages to be washed out and grainy while the webcam looks just fine.