While an ideal capacitor in theory does not have any resistance, practical capacitors do exhibit resistance in the forms of ESR and leakage resistance. A capacitor does have some resistance in practical sense. Whenever a capacitor gets charged, current flows into one of the plates and current flows out of the other plate and vice versa.
There are several other factors that go into this decision including temperature stability, leakage resistance (effective parallel resistance), ESR (equivalent series resistance) and breakdown strength. For an ideal capacitor, leakage resistance would be infinite and ESR would be zero.
Resistors are often used in combination with capacitors in order to control the charge and discharge time necessary for the intended application. Resistance directly affects the time required to charge a capacitor. As resistance increases, it takes more time to charge a capacitor. What is the function of a capacitor?
Placing a resistor in the charging circuit slows the process down. The greater the values of resistance and capacitance, the longer it takes for the capacitor to charge. The diagram below shows how the current changes with time when a capacitor is charging.
This is the resistance due to the leakage current that flows through the dielectric material of the capacitor when a voltage is applied across it. Ideally, this should be very high, indicating very low leakage current, but in real capacitors, it is finite.
A capacitor in practical never has air between the plates, but some other dielectric medium. But it's resistance is ideally infinite. It is true only for stationary currents. That is why you replace the capacitors with open circuits, in the stationary current analysis.