A capacitor blocks direct current (DC) because once it is fully charged, the capacitor plates hold opposite charges, creating an electric field that opposes further flow of electrons. This means that after the initial transient period when the capacitor is charging, no steady current can flow through the capacitor in a DC circuit. Essentially, the capacitor behaves like an open circuit to DC after it reaches full charge.
In contrast, a capacitor allows alternating current (AC) to pass through it because the voltage across the capacitor is constantly changing with time. As the AC voltage varies, the capacitor continuously charges and discharges, causing current to flow in the circuit. During the positive half-cycle of the AC signal, the capacitor charges in one direction, and during the negative half-cycle, it discharges and then charges in the opposite direction. This repeated charging and discharging process enables the capacitor to conduct AC, effectively allowing AC signals to pass while blocking DC.
Thus, capacitors act as frequency-dependent elements in circuits: they block DC signals (zero frequency) but allow AC signals to pass, with the degree of conduction depending on the frequency of the AC signal.