Internally, the analog input pin connects to a capacitor. The A/D circuit then reads the voltage on the cap.
Connect the capacitor to ground, reads 0.
Connect the cap to +5 either directly, or with a pullup resistor, or a pullup thermsistor, it reads 1024.
Connect a thermistor from 5V to the cap, a resistore from the cap to ground, now you have a voltage divider, and the voltage will vary as the thermistor value varies.