The VANOS system provides mechanical variable timing of the camshaft to improve performance. The computer needs to know the position of the cam in order to fire the spark plugs and fuel injectors at exactly the right time. The sensor provides this position feedback to the computer. Without this information, the computer is probably programmed to default to a "safe" mode but it will not run well.
The sensor is an electronic component, similar to a transistor, known as a Hall Effect sensor. It detects tiny changes in the natural magnetic field around the cam to determine the position. It sends pulses to the computer as the cam spins. Like any electronic component, sometimes they just fail.