Let's take a deep dive and look at how exactly each GPIO pin on the Pi works. Each pin has two functions, which are what make up the IO in GPIO. Each pin can write binary values (and by values, what I mean is it can give an output between 0 and 3.3v) and also read binary values.
The pin as a standalone component
The Write mode
In the Write mode, the Raspberry Pi acts as a switch and a power source.
This diagram represents the hello world of circuits, that is, an LED along with a resistor connected to a power source. An important thing to remember is that any GPIO pin needs a reference, relative to which it can be high or low.
The Raspberry Pi can act as either end of this circuit and has two different ways of being an...