Turbocharged engines operating at wide open throttle and high rpm require a large volume of air to flow between the turbo and the inlet of the engine. When the throttle is closed, compressed air will flow to the throttle valve without an exit (i.e., the air has nowhere to go).
In this situation, the surge can raise the pressure of the air to a level that can cause damage. This is because if the pressure rises high enough, a compressor stall will occur, where the stored pressurized air decompresses backward across the impeller and out the inlet. The reverse flow back across the turbocharger causes the turbine shaft to reduce in speed more quickly than it would naturally, possibly damaging the turbocharger.
In order to prevent this from happening, a valve is fitted between the turbo and inlet, which vents off the excess air pressure. These are known as an anti-surge, diverter, bypass, blow-off valve (BOV), or dump valve. It is a pressure relief valve, and is normally operated by the vacuum in the intake manifold.
The primary use of this valve is to maintain the spinning of the turbocharger at a high speed. The air is usually recycled back into the turbo inlet (diverter or bypass valves) but can also be vented to the atmosphere (blow off valve). Recycling back into the turbocharger inlet is required on an engine that uses a mass-airflow fuel injection system, because dumping the excessive air overboard downstream of the mass airflow sensor will cause an excessively rich fuel mixture (this is because the mass-airflow sensor has already accounted for the extra air that is no longer being used). Valves that recycle the air will also shorten the time needed to re-spool the turbo after sudden engine deceleration, since the load on the turbo when the valve is active is much lower than it is if the air charge is vented to atmosphere.