The battery maintains the potential difference across connected capacitor in every circumstance. However, charge stored by disconnected charged capacitor remains conserved.
CaseA: When key K is kept closed and plates of capacitors are moved apart using insulating handle.
The battery maintains the potential difference across connected capacitor in every circumstance. The separation between two plates increases which in turn decreases its capacitance (C=ϵ0Ad) and potential difference across
connected capacitor continue to be the same as capacitor is still connected with battery. Hence, the charge stored decreases as Q=CV.
CaseB: When key K is opened and plates of capacitors are moved apart using insulating handle.
The charge stored by isolated charged capacitor remains conserved. The separation between two plates is increasing which in turn decreases its capacitance with the decrease of capacitance, potential difference V increases as V=QC.