Each potentiometer consists of a resistor, in the form of a curved track, and a movable contact arm. The computer power supply conducts electricity to the input terminal, through the curved resistor, through the contact arm and back to the joystick port on the computer.
By moving the contact arm along the track, you can increase or decrease the resistance acting on the current flowing through this circuit. If the contact arm is on the opposite end of the path from the input connection terminal, electricity will have to flow through a long length of resistor, so it will face maximum resistance. If the contact arm is near the input terminal, the potentiometer will have minimal resistance.
Each potentiometer is connected to one of the joystick shafts so that pivoting the shaft rotates the contact arm. In other words, if you push the stick all the way forward, it will turn the potentiometer contact arm to one end of the track, and if you pull it back toward you, it will turn the contact arm the other way.
Varying the resistance of the potentiometer alters the electrical current in the connected circuit. In this way, the potentiometer translates the stick's physical position into an electrical signal, which it passes on to the joystick port on the computer.
This electrical signal is totally analog -- it's a varying wave of information, like a radio signal. In order to make the information usable, the computer needs to translate it into a digital signal -- a strict numerical value.