A capacitor stores energy as a function of voltage and resists charges in voltage by drawing current from or supplying current to the source of the voltage charge.
A capacitor blocks DC as once it gets charged up to the input voltage with the same polarity, then no further transfer of electrons can happen to accept to replenish the slow discharge due to leakage. The flow of electrons which represents electric current is ceased.
However, in the case of AC, the transfer of electrons continues as the dielectric is not able to store the potential input and it continues to transfer electrons.