capacitor working principle