How do these capacitors in this BJT Darkness Detection circuit work?
The capacitors apply some positive feedback (positive in the sense that it's the same polarity as the original signal) to switch state suddenly. Imagine it as follows, numbering transistors from left to right:


The light is on. 
LDR resistance is low. Q1-b is pulled low so there's no collector current and Q2 is off and its collector voltage is pulled low by the 1 k resistor.
The light level starts to fall.
LDR resistance starts to increase. Q1-b voltage rises turning on Q1. This turns on Q2 a little and Q2 collector voltage starts to rise.
This means that the right side of the 4u7 capacitor gets a 'lift' and charge flows from its left side into Q1-b turning it on even more. The effect is to square-up the edge of the signal from the LDR.


The second stage is similar but it doesn't require the same amount of positive feedback so it is using a smaller capacitor.