Two different methods:
In left circuit, close switch and voltage collapses. The 1k load is in parallel with the lower divider resistor so changes the ratio.
In the right circuit, close switch and 5V is maintained. The extremely high input impedance of the op amp has negligible effect on the lower divider resistor and does not affect the divider ratio.