An operational amplifier is a specific type of integrated circuit, which is pretty much just a circuit on a chip, mostly comprised of transistors and resistors. Some op amps have very complicated circuits inside; the simplest ones and old classics already have tens of transistors inside. You can plug this circuit into part of a larger system, connecting any inputs, outputs, power rails it may require. There are a vast variety of op amp models that are produced, using different internal circuit designs and composition, so the electrical behavior and tolerances are different. Some are good for some applications and useless for others. Early op amps had poor performance for pretty much every audio circuit. Overall, they cover a wide range of uses, but of course not everything. They're commonly used in all sorts of electronic circuits.
For an electronics design, if you need a subsystem that handles a certain functionality or otherwise has some electrical purpose, there may be some op amps or circuits making use of op amps that have acceptable performance for the task. In many applications, depending on the circuit and op amp, describing it as "acceptable performance" may be an understatement. Using an op amp may save on cost and space (as mentioned by others), and it could potentially save on power consumption and R&D time/effort as well, compared to an alternate implementation. Because of the consistency of semiconductor manufacturing, there are some other benefits as well (tolerances, having some guarantee of components matching well, and so on).
For some applications where op amps would work, you can achieve higher performance with discrete parts. Also, as mentioned by others, op amps are constrained in the power they can handle (also voltage, current). For example, in some situations there may not exist an op amp that can handle the voltage and that has the performance characteristics you need. If you want a really powerful amplifier, you may want to use a discrete output stage, using separate transistors and so on—though for a headphone amplifier, it's probably not really necessary. After all, there exist integrated amplifier chips that can handle the power levels required for most speakers, so of course that's enough for headphones.
As for sound quality, you should look at the entire design. It's not right to make a sweeping statement one way or the other, because it depends on a lot of other factors.
edit: also keep in mind that there are a lot of ways to do the same thing, pretty much. Different methods have different advantages and disadvantages.