IC 555 has an internal Flip-Flop and its working determines the output state of the IC. The discharge input of the IC has an NPN transistor with open collector. The On/Off of this transistor also depends on the state of the Flip-Flop. The Flip-Flop is under the control of the lower and upper comparator of the IC which can be independently controlled by external voltage. Here two LDRs are used for controlling the comparators.
LDR1 is used to Reset the Flip-Flop and LDR2 to Set the Flip-Flop. When there is darkness, trigger pin2 of IC will be grounded and Resets the Flip-Flop. Output then turns high and LED lights. At the same time Buzzer turns off since transistor is not conducting.
When the LDR 2 is dark, IC sets and output turns low. LED turns off but buzzer starts beeping since the transistor conducts. The condition reverses if the LDR1 and LDR2 expose to light individually