Please help me understand the following light-controlled relay circuit
The point of the 100k feedback resistor is to provide hysteresis. Without it, if the LDR was very close to the threshold, it could switch on and off rapidly. Adding the feedback resistor will change the voltage level of the non-inverting input when the comparator is activated. This will mean that the LDR will have a bit of headroom to once again reach the threshold voltage.

 

This picture shows how the hysteresis helps. You can see that once the non-inverting input has reached the lower threshold, the OUT changes LOW. Only when it reaches the upper threshold will it go back high again.

Without hysteresis, you could end up with an unstable output, especially if the light level is very close to the threshold

 

Some further reading on this can be found in a nice application note by Maxim Integrated: Application note 3616

This application note goes through the math required to select values for your resistors. The only one it cannot select is your LDR. You can, however, calculate a fixed resistor, then choose a suitable LDR from that.