How is op amp output not zero if inputs have the same voltage?
I think your confusion comes from the differences between a theoretical ‘ideal’ op-amp and what’s actually realizable with electronics. tl; dr: the real op-amp using negative feedback will have a residual voltage difference on its inputs due to its limited gain.
Let’s walk through this.
The ‘golden rules’ of ideal op-amps are:

infinite open-loop gain (implies infinite voltage and zero output impedance)
infinite impedance inputs

Apply a difference of zero volts to both inputs and the output will be exactly zero. Apply any difference and it will get amplified to + or - infinity.
Add negative feedback, and the feedback path from the output forces the (-) input to bring the inputs back into balance. Thus, the (-) input tracks the (+) input exactly, such that input difference will always be zero.
Real op-amps don’t have infinite gain. They do however have very high gain (some in the 120dB / 1 million range.) They also have some other deviations from ideal that creep in and influence the output. More on those below.
The upshot is, our imperfect real-world op-amp will have a nonzero voltage difference at the terminals for any output other than zero volts. This can be found from the open-loop gain.
For example, that op-amp with 120dB (10^6) open-loop gain showing 1V on the output will have 1 microvolt difference on the inputs. Stated another way, a 0dB signal on the output will be showing a -120dB signal on the input. This is true regardless of the feedback. It is determined strictly by the gain.
Simulate it here: unity follower using op-amp with 10^6 gain
With such a high gain, this residual input voltage difference is practically insignificant when compared to the other errors that bedevil op-amps in the real world. Let’s talk about those.
More about Ideal vs Real Op-Amps
Besides less-than-infinite gain, real op-amps have a number other errors that influence the output. An incomplete list of these include:

Input offset voltage
input bias current
common-mode rejection ratio (CMRR)
frequency-dependent gain / limited slew / phase offset (AC gain)
limited output compliance

Input offset needs to be accounted for when very high gain or low input voltages are in use.
Bias current comes into play when very high gain or resistance feedback values are used. Bipolar op-amps specifically will need this accounted for, less so JFET or MOSFET-input devices.
Common-mode rejection means that the common DC voltage on (+) and (-) can influence the output with an offset. Ideal op-amps have infinite rejection; real op-amps do not. The popular LM324 for example has a CMRR of about 80dB (a little under 10,000:1).
Real op-amps have gain that decreases with higher frequency, especially for internally-compensated general-purpose op-amps like the LM324. Some phase error is introduced as well. The higher the gain used, the more this has an effect. This is described as the gain-bandwidth product.
Finally, the output compliance range (output swing) will limit the gain that is possible. The op-amp output impedance also limits the amount of current it can push back to the feedback network.
Taken together, these non-ideal characteristics of op-amps set limits on realizable op-amp circuit performance. It’s no wonder that there are so many different kinds of op-amps to choose from.
Further Reading
Here's an MIT Open Course Ware paper with more in-depth analysis of ideal, infinite-gain vs. real, finite gain op-amps, showing the generalized equations: https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-071j-introduction-to-electronics-signals-and-measurement-spring-2006/lecture-notes/22_op_amps1.pdf