Opamp using Transistor Query?
Your average op amp might look something like this:







simulate this circuit &ndash; Schematic created using CircuitLab

That's a very basic two stage op amp: the first stage is built with M1-2-3-4 and is a differential stage, while the second stage is built with M5 and is a sort of common source stage. M6-7-8 just bias the whole thing.

Looking at M3-M4 you can see they form a current mirror, M7 dictates the total current and \$V_{i1}\$, \$V_{i2}\$ produce an unbalancing in the two branches: when \$V_{i1}\$ is higher \$v_{gs1}\$ is lower, \$i_{d1}\$ is lower and it equals \$i_{d4}\$, but from M2 you have some increased drain current. So basically you have more current coming from M2, less flowing in M4, where is the difference going? Not in M5 gate for sure, it flows in the mirror output resistance, that is very high, thus producing a very high increase in the gate voltage of M5. \$i_{d5}\$ would increase but M6 is part of a mirror and he's not willing to let the current increase. Again, this extra current flows in the mirror output resistance thus producing a very high voltage swing on \$v_{out}\$. Please note that the total gain is thus something like (Very High)\$^2\$.

All true analog design engineers, please forgive me.

some notes

In the "analysis" made I've assumed all drain currents positive, that's true only using the "common sense" drain current convention, i.e. positive current flows from top to bottom. Please note that this schematic is very very basic, you'd at least need an RC series from output node to M5 gate to compensate, plus the bias part is omitted of course.