When an alternating-current source is connected to a capacitor, the electric field between the plates of the capacitor keeps on changing with the applied voltage. Due to the changing electric field, a magnetic field exists in between the plates of the capacitor.