Here is a simple but by no means complete explanation: In all physical
system the amplitude of the output decreases with increasing frequency.
Therfore no physical system can have an infinite frequency response. The
frequency response of a system may be flat for awhile with increasing
frequency but always breaks off and begins to decrease and some frequency.
Each such break point is called a pole. Each pole or break point has an
associated phase shift of 45 degrees at the pole frequency and ultimatly
approaching 90 degrees at frequencies way higher than the pole.
A series resistor connected to a shunt capacitor is a single pole device. It
has a pole frequency of 1/(2*pi*R*C) Hz. At low frequencies, signals go
right through and at higher frequencies, beyond the pole frequency the
amplitude decays and the phase shift increases towards 90 deg at very high
frequencies. It's 45 deg at the pole. Mechanical systems with intertia have
similar responses. Most real system have multiple poles accumulating 90
degrees of phase shift for each pole. Phase shifts of 270 degrees or beyond
are not uncommon.
All is well and good until one trys to put feedback around such a system.
Negative feedback is used to control a system and keep it responding
accurately to a control signal. Feedback takes some of the output signal and
compares it with the control signal then re-applies it to the input. If the
feedback is negative, the output follows the control, but if the feedback
becomes positive, the output re-stimulates the input in an increasing way
and the output slams into its stops and is unstable.
Since all systems have poles, all systems have phase shift. If there are two
or more poles, the phase shift at some frequency becomes 180 deg or more, 2
X 90 deg. If this system is connected with feed back, at some frequency the
negative feedback gets shifted 180 deg. and become positive feed back. This
ain't good and the system will oscillate at that frequency.
If the gain around the total loop including the feedback is less than one,
positive feedback will not cause instability because gain less than one
means the system output will settle out and does not re-stimulate itself
regardless of phase shift. A gain less than one does not regenerate.
The goal and purpose of compensation is to keep the phase shift from
accumulating to 180 Deg. before the loop gain decays to unity. It also
should push the frequency response as high as possible and keep undershoot,
overshoot and oscillatory behavior in bounds.
Lead-lag compensation is one type but not the only type. The lead network
has a zero in the response; i.e., a response opposite that of a pole. It has
a leading phase response and is used to cancel or nearly cancel one of the
natural poles. This pushes the frequency response out and also reduces the
phase shift for a while, but it keeps the gain high. It also introduces
another higher frequency pole because it not possible to have a zero (lead)
without a pole further out in the response.
In order to get the gain to decay to unity at a reasonable frequency before
the phase accumulates to 180 deg., a lag network is added to the lead
network. This adds a pole at a strategic location to drop the gain below
unity before the phase shift accumulates to 180 deg.
That's it in a nut shell, but it takes knowledge of the system and some math
to figure what to do to get the best response and stability.