As an engine is running, exhaust gasses blow by the piston rings and into the crankcase. In the old days, these hydrocarbon-laden gasses carrying atomized oil droplets from the crankcase were allowed to escape into the atmosphere, and also as a result cars would leak oil as a matter of course. In order to stop the oil leaking, a breather was added that pulled air out of the crankcase near the top and let it out into the atmosphere. Because the oil droplets were heavy and the gasses were essentially syphoned off the top, this kept the oil leakage to a minimum but did nothing to stop the harmful hydrocarbons from escaping into the atmosphere.
During the 1950's the correlation between increased smog and released hydrocarbons from engines was proven. Coincidentally, General Motors had developed a technique in wartime to ventilate battle tanks when they were going through deep water by recirculating exhaust gasses into the intake manifold. It so happened this technique also reduced emissions. So in an early environmentally conscious move, GM's Cadillac division made this technology, called Positive Crankcase Ventilation (PCV) available royalty free to all U.S. automobile manufacturers, and its use became mandatory in California in 1961.
The PCV valve is actually a rather simple mechanism, sometimes also called a "non-return valve". It allows airflow in one direction but not in the other.
The idea of the entire PCV system is to use the vacuum in the intake manifold to draw the exhaust vapours in the crankcase back into the intake manifold. Along the way, the gasses are fed through a labyrinth of oil separators (basically just bendy paths and swirly cyclones and other good ideas) whose function is to get the oil droplets out of the gasses and have them drip back down into the oil sump. you don't want engine oil getting into the cylinders, because it will lower the ignition point of the mixture and cause knocking. After the oil is separated, the gasses are then recycled back into the cylinders to be blown up again and pushed out through the exhaust system past the catalytic converters that get rid of most of the noxious fumes.
That basic technology is still in use today, and is essentially what is used in the F10 M5. The precise method for doing this depends on if the turbochargers are spooled up and there is pressure in the intake manifold, or if the engine is running in a naturally aspirated (NA) mode (at low RPMs) with vacuum in the intake manifold. This is all controlled by pressure valves.
The illustration here shows one of the two cylinder head covers with the ventilation system attached.
The blow-by gasses come up from the crankcase through channels in the block and heads to (6). At (3,4,5,11) the gasses are put through a labyrinth and cyclone chambers to separate out the oil, where it is returned to the crankcase (7,8).
In low RPM naturally aspirated mode (shown below), the gasses are re-injected into the intake just ahead of the intake valves (9 above). This is assisted by a small amount of fresh air coming in through a pinhole at (1 above and below). In this case, it is the vacuum in the intake manifold that draws the gasses through the labyrinth and into the cylinders.
In turbo mode (at higher RPMs), this won't work, and this path is closed by the PCV valve (10 above). It is very important that this path be closed, as we do not want pressurized air leaking into the crankcase instead of going into the cylinders. So instead, a differnet way of drawing the air out is required. The high pressure gasses are drawn through a pipe (2) and a non-return valve (1) back into the intake upstream of the turbo, as is shown below.
The requirement on U.S. car manufacturers to use the PCV valve and crankcase ventilation system was the first emission control standard. Since then, California has consistently led the way in defining ever more stringent emissions control standards ("Low Emission Vehicle Program", LEV 1 for 1994, LEV 2 in 2004, and LEV 3 for 2015 model year cars), challenging the automotive industry to create better and better designs.