Logic gate sources move current to the AND gate. The voltage-controlled voltage ensures that the voltage remains at 5V at all times. The relay works if and only if the AND gate makes an output of 1 (5V). Finally, the circuit closes when the AND gate makes 5V to the relay.