How is the resistance of a capacitor generated