In order for an input pin to be able to read a real value it must be connected to something - either a power source (Vcc) or to ground. If it's not connected to either of those and left "flapping in the breeze" then it's said to be floating and the input value cannot be determined.
So you need a way of switching that input pin between being connected to Vcc or being connected to GND. That is why there are three wires - the input pin and the two voltage levels that must be chosen between.
Now an input pin has a very high resistance (impedance) to ground. So when you connect it to Vcc a very tiny current will flow through it to ground, thus completing a circuit. If you add another resistance between the pin and Vcc the incredibly small amount of current that flows will only cause the smallest of voltage drops across that new resistor (see Ohms Law). So connecting the input pin to Vcc through a 10kΩ resistor (for example) will mean the voltage read at the input pin will be only fractionally below the +5V of Vcc.
Now when you introduce the pushbutton, which connects the input pin to ground when pressed, will also connect the resistor to ground. So you have the full 5V of Vcc across that resistor, and the input pin will be reading 0V.
Without the resistor in there - if you just connected the input pin to Vcc and then had the button connecting to ground - as soon as you press the button it would connect Vcc directly to ground, which is a really really bad thing to do. That's called a short circuit, and it's when batteries start to explode and wires melt.
So the input pin itself is basically a voltage detector that detects what the voltage at the input pin is. It has two thresholds known as VIH and VIL - the input logic voltage for HIGH and LOW respectively. On the Arduino those are 0.6Vcc and 0.3Vcc - or 60% of the supply voltage for high, and 30% for low. At 5V that's 3V and 1.5V respectively. If the voltage seen at the input pin is above 3V then it's seen as being HIGH. If it's below 1.3V then it's seen as being LOW.