How does analogRead know minimum and maximum value

Almost right. The potentiometer IS a voltage divider in it self.

So you can hook the middle pin up directly to an analog in, turning the pot from 0 - max will give 0 - 5V on the middle pin. Arduinos ADC is optimized for using a 10K pot for this. It has something to do with hom much current is running through the pot.

And for the CdS cell yes you are right you need another resistor and then connect the junction of the CdS and the resistor to the analog in pin. You could even use a trim pot as the second resistor, this would give you adjustable sensitivity.