Fun with Op Amps

One can see the same potential applied to both inputs of the op amp, causing 0V output potential. That made sense. When connecting the inverting input pin to half the potential of the output (using two 10 kΩ fixed resistors as a potential divider), the output potential became 10V. Well, half of 10V is 5V, so that would make the inverting input potential 5V, the same as in the first case, yet the output potential is different.