This is a simple circuit which dims the LED according to the light recieved by the LDR or simply a light switch.
Can anybody explain how two BJTs opearete in the circuit, or simply how the system works?
Assuming everything is biased reasonably, ...
More current through LDR1 produces more current into the base of Q1.
That produces more current into the collector of Q1, which would normally mean more current through R1.
But, the voltage at the collector of Q1 is effectively pinned by the LED D2. So what actually happens is that more current into the Q1 collector has to come from diverting current that would otherwise have gone into D2, and the voltage there only changes very slightly.
Since there's less current flowing through D2, the light output is dimmed.