The valves work by having power applied between the terminal for the valve and the common. Most rain sensors work by simply breaking the connection in the common when they are wet. So the way to wire the typical sensor is to remove the common wire from the common terminal on the controller, connecting the common wire to the sensor, and running another wire from the common terminal to the other terminal on the sensor.
Once installed, the controller will still try to apply power to the valves at their scheduled time, but if the sensor is wet, it will keep the connon to common broken and the valve will fail to open.
Now there are some smart controllers out there where rather than inserting the sensor inline with the common, there is a dedicated sensor terminal on the controller. I beleive that for this type of controller, you connect the sensor across the sensor terminal and common WITHOUT removing the common wire from the common terminal. The sensor still works by opening/closing an electrical connection, but these smart controllers utilize the senser terminal to effectively ask the sensor if it is wet before it bothers to attempt to send power to the valves.