When water is on the sensor, the angle of refraction and reflection change, and the ir collector suddenly sees much less light.
Two components, plus a microcontroller. Usually two such sensors are on the windshield. Absolutely dead simple and cheap.
Why the fuck would you replace that with a camera trying to parse video?! That's so much more complicated. That's like trying to determine vehicle speed from a camera rather than sensors on the tires or whatever.