Another, potentially cheaper way to replace a webcam is to use the main (rear) camera of an old cell phone.
Digital photography, especially using tiny sensors, is computational photography. Webcams are too cheap to have reasonable processing power internally and webcam companies don’t have the budget to create high quality post processing software for the host computer.
Also, seconded on the difference a larger sensor and better glass make for a webcam.
Dynamic range, noise, and resolution are significantly better.
Big sensor + nicer fast lenses means you require a lot less light. Nice fast glass means you can blur out the background optically without all the artefacts introduced by software background removal. If you use a zoom lens, you have a tonne of control over the framing.
It's a nice second life for it.