Now Assume you Connect your capacitor to a DC source. Now DC current has no frequency,
We Can Say, f=0
Put This Value In Capacitance Reactance Equation,
Then You Get Capacitance reactance =
Now As You Know Infinite Reactance Value Means That It is impossible For the Electron Flow.
Hence Capacitor Block A DC.
Why Does A Capacitor Allow AC?
However, DC current does flow through the capacitor till the time the plates of the capacitor are fully charged.
Now If you want to see this, connect an LED and a capacitor in series to a battery. You Will see the LED light up for a short interval of time and then it Light off. So, once fully charged, a capacitor acts like an open circuit.
But if you were to Connect an AC source instead, it has some finite frequency. Because of this finite value F, Reactance Value Does Not Blow Up to Infinite, instead takes up some finite value.
Hence Capacitor Allow Ac Current to Pass.