Compensation network can be used to ensure op-amp stability. A compensation network is simply a network of external and internal poles. The purpose of these additional poles is to deliberately move the gain curve to the left so that by the time it rolls off to unity gain, the overall phase shift is less than 360°. This technique is called dominant pole compensation (see figure below). This example assumes that the open-loop gain of the op-amp is 100dB. By adding a pole network to the circuit, the gain is now reduced to 60dB. Obviously, the downside to this frequency compensation technique is that the desired gain is now at a lower frequency, reducing amplifier's bandwidth. In other words, you are trading off gain for bandwidth by adding a dominant pole. There are other types of compensation schemes to ensure amplifier stability such as lead, lag, and feed-forward compensations.