It takes the difference between of two input and amplify by the open loop gain of the amplifier or closed loop gain of the amplifier. It is very hard to control open loop gain of 100 Db so it very...
It's function is to perform integer and difference solutions to analog inputs. It has - and + inputs. By choosing capacitive or resistive feedback you can alter the signal as needed....
In the old days, Op Amps were used in analog computers to perform mathematical 'operations', such as summing, differentiation, integration etc. Hence the name.