Complex subject, but in a nutshell it has to do with maintaining a certain amount of flow through the compressor.
It is at low flows that the flow characteristic of the machine is unstable. It can be a seismic experience if you are on the compressor deck when the machine goes into surge...
Simple systems use flow/diff. pressure to control the recycle valve. More sophisticated systems used a combination of discharge flow, machine d/p, and temperature to detaermine the on-set of surge and adjust the recylce valve accordingly.