Imagine the permanently-on switches on the right as pins. If you open these switches, the pins will be floating (will turn dark grey). The left pin is pulled up to 5V through the upper 10k pull-up resistor. The right pin is pulled down to ground (0 V) through the lower 10k pull-down resistor. The two open switches in the middle are buttons pressed by the user. These buttons toggle the logic state of the pins.