why does a capacitor block the DC and passes the AC?
A capacitor blocks DC current because when a capacitor is placed in a DC circuit, it quickly becomes charged in such a way as to oppose the applied voltage and all current stops.
Electrons from the source will reach the plate and stop, and they cannot jump across the gap between plates to continue its flow in the circuit.
In contrast, when a source of AC voltage is connected across a capacitor, the capacitor never has time to “adapt” to it and so won’t build up a charge that opposes the current.
Capacitors act like a short at high frequencies and an open at low frequencies, so AC is able to get through, but DC is blocked.