The photoresistor and 10K resistor are set up as a voltage divider. Pin A0 is most likely being used as an analog input sensing the voltage level of the voltage divider. With photoresistors the resistance decreases as the light level increases, causing the voltage divider to output a higher voltage, towards +5. The analog circuitry behind pin A0 converts the voltage level to a digital number going from 0 - 255. Somewhere in the sketch this number is compared to several parameters set up to decide when to switch the LED on or off.
In a voltage divider current is always flowing through it unless one of the elements' resistance goes to infinity (open circuit) at which point the divider output will assume the voltage of the leg with the lesser resistance. If the resistance of both members is equal then the divider will output one half of the applied voltage.
Your assertion that the current flows through the photoresistor then to ground and then eventually to pin A0 is not backed up by your circuit. The current flows through the photoresistor and then divides between the 10K resistor to ground and pin A0.
You may want to study basic circuits a little more to better understand how they work.