It is a hydrophobic silicone polymer that forces water to bead and roll off.
Rain-X's primary active ingredient are polysiloxanates, the primary one being hydroxy-terminated polydimethylsiloxane.The polysiloxanes have functional groups that bind to the hydroxyl group of the glass surface.
The most important disadvantage of RainX is in the fact, that a large part of the liquids that splash on the cars windshield is not the pure water from the sky, but dirty water from the road. This water contains small droplets of oils from the road. While the water does not wet the modified glass surface, the oil droplets adhere to it very well.
These oils have very high boiling point and, unlike water, do not evaporate easily after the rain. This could lead to smearing if a significant amount of oil is deposited on the windshield. However, this can be cleaned off with washer fluid or with a squeegee.