Basically, joystick detects the direction you are holding the stick in by use of an electronic switch. There is a printed circuit board inside the joystick base. The terminals can't complete the electric circuit when the joystick is in a neutral state (the stick is not pressing the contacts into the 'on' position).