The photoresistor is sending an analogue value back to the microcontroller. The analog value is proportional to the amount of light that is hitting the photoresistor. The microcontroller then interprets this value and compares the values of the left and right sides. So if the left sensor has a greater value than the right, there is more light on the left side, and therefore you tell the robot to turn left, and vice versa. If they are equal, it goes straight.