What exactly is an op-amp?
An opamp is a very simple device that does this: Vout = Gain*(Vin+ - Vin-). The Gain is fixed for each opamp and is usually 100,000 or higher. To make matters more interesting, this gain value is not very "tight". The gain of a real opamp might change over some large range depending on temperature, voltage, batch, frequency, etc. I would not be surprised to see this gain change from 100,000 to 1,000,000 in the same opamp.
Most practical opamp circuit require negative feedback to produce other gain values and to make the opamp behave more predictably.
What was the idea behind its creation?
I can't ask the guy who designed it, but simply put an opamp is one of the most flexible semiconductor devices available today. I am guessing that the original inventor knew this and that's why it was invented. So in a sense, this question is a bit like asking "why was the wheel invented". But this is a super generalization.
The op-amp itself is an integrated circuit, a chip. Before chips there were discrete transistors, and before that there were vacuum tubes. There are circuits that are functionally equivalent to opamps that were used back in the tube days. So the chips that we call "opamps" are "just" modern manifestations of those tube circuits.
What is an opamp composed of?
Modern opamps consist of transistors, diodes, resistors, and some other minor stuff. Of course they used to be made of tubes. The following image shows an internal schematic of one opamp:
Of course there are hundreds (or thousands?) of different opamps so there are many different internal schematics. Some of them are much simpler than this one.
I glossed over this before, so I'll restate it here: Most practical opamp circuits require negative feedback to make things work well. Without feedback, an opamp works nicely as a voltage comparator. For almost everything else, negative feedback is required. This feedback is the source of much magic, and the reason why opamps are so useful. Feedback is beyond the scope of this question/answer, but suffice it to say that this is where the important stuff happens.