What is importance of resistance in charging and discharging of capacitor?
It moderates the timescales of the charging and discharging. If there is no connection between terminals, it remains charged. If there is a short circuit connection between terminals, it discharges instantly. Practical considerations: Even when you charge it with a DC voltage source, that source has an internal resistance associated with it, so there is no escaping resistance. Even the short circuit has small resistance in the wiring.