These systems are ingenious. The flow of the water pushes against a lever and the moment from that impulse force is greater than the moment from the spring so the lever is pushed out of the way and water escapes. There is then no impulse force so the spring provides the resultant moment and the lever springs back cutting off the water supply. I didn't get close enough to work out how the system gives angular momentum to spin the spray.