There's something in computer theory called a "logic gate". It's a device that has two inputs and one output. The only input it accepts is "on" or "off", and the output is the same, "on" or "off". You might see the relation to binary.
A logic gates output is dependent on its input. One kind of a logic gate is the NAND gate, shown below. Try turning the switches on: