As mentioned in opamp datasheets, like this one. I would think stability is a problem at higher gains, due to oscillation. What are the problems with unity-gain?
Stability doesn't only depend on gain, but also phase. If an inverting amplifier has a 180° phase shift total phase shift is 360°, and one of the Barkhausen criteria for oscillation is met.
Amplifiers differ in their ability to be stable even if the external circuitry is optimum. To evaluate the stability potential for a particular amplifier type, graphic data is required for both "gain vs frequency" and "phase vs frequency" of the open loop amplifier. If the phase response exhibits !180E at a frequency where the gain is above unity, the negative feedback will become positive feedback and the amplifier will actually sustain an oscillation. Even if the phase lag is less than !180E and there is no sustained oscillation, there will be overshoot and the possibility of oscillation bursts triggered by external noise sources, if the phase response is not "sufficiently less" than -180° for all frequencies where the gain is above unity. The "sufficiently less" term is more properly called phase margin. If the phase response is -135°, then the phase margin is 45° (the amount "less than" -180°). Actually, the phase margin of interest to evaluate stability potential must also include the phase response of the feedback circuit. When this combined phase margin is 45° or more, the amplifier is quite stable. The 45° number is a "rule of thumb" value and greater phase margin will yield even better stability and less overshoot.
Often, but not always, the lowest phase margin is at the highest frequency which has gain above unity; because there is always some delay independent of frequency which represents more degrees at higher frequencies. An amplifier with 45E phase margin at the higher frequency of unity open loop gain is said to be "unity gain stable". Optionally, most amplifier types can be compensated for unity gain stability at some sacrifice in slew rate or high frequency noise. If stability is considered to be of high priority, the tradeoff must be made. Unity gain stable means stable operation at the lowest closed loop gain where stability is usually worst.
Why Unity Feedback is Most Difficult for Stability?
Unity gain is achieved by applying 100% feedback to a high gain amplifier. There will be phase shift between input and output and oscillation occurs when phase shift equals or exceeds 180 degree at any frequency where the open loop gain is greater than unity (actually always in practice at a range of frequencies.)
The unity gain high feedback situation is about the hardest one in which to avoid some frequency (usually at the top of the response range) having 180 degrees phase shift.
In practice "just less than 180 degrees" is not good enough as amplifers approaching oscillation will "ring" and produce undesirable transient response on fast edges or on signals with higher frequency components. Therefore, a degree of "phase margin" is required, so that phase shift across the system is well clear of 180 degrees at all frequencies that may be encountered, in order to keep the amplifier away from areas where it starts to behave badly.
Negative feedback stabalises amplifiers while positive feedback destabalises them.
Due to parasitic resistance and capacitance an amplifier inevitablly ends up acting as a lowpass filter. This means that in addition to attenuation there is a phase shift. The more stages an amplifier has the more potential there is for phase shifts.
The frequency response of an amplifier with two or more stages (i.e. pretty much all op-amps) will contain multiple break frequencies. Arround each break frequency the phase shift increases. After the first break frequency there is about 90 degrees of phase shift, after the second break frequency there is about 180 degrees of phase shift (and so-on but we really only care about the first two).
A 180 degree phase shift turns negative feedback into positive feedback. That's a problem. If the "loop gain" of the feedback path at that point is one or more than the amplfier will oscilate.
So we have to engineer our amplifiers so the gain in the feedback loop drops to less than one before the second break frequency is reached. OP-AMP manufacturers do this by deliberately adding capacitance (known as "compensation") to thier amplifiers to reduce the frequency of the first breakpoint and hence reduce the gain at the second breakpoint. Of course this reduces the bandwidth of our amplifier.
But the gain in the feedback loop depends not only on the amplifier but also on the feedback divider. The higher closed loop gain of your amplifier the lower the gain in the feedback loop. The non-inverting unity gain amplifier is the worst case as it feeds back 100% of the output to the input. So low gain amplifiers need a large compensation capacitance than high gain ones.
So makers of high speed op-amps give you the choice. Sometimes this is done by having different models of amplifer for low and high gain applications. Sometimes (for example on the AD8021) this is done by fitting the compensation capacitor externally.