Basically an led emits infrared rays through the rain sensor tape and through the windshield glass. If there is no rain on the glass all the rays are reflected back to a photo diode. If there is rain on the glass a certain amount of the rays go right through the glass, through the drops of water and keep on going. By measuring how many of the rays make it back to the photo diode the wiper ecu calculates what wiper speed is needed.
-Jon