The air flow sensor tells the engine's computer how much air is coming into the engine so the computer knows how much fuel to mix with the air. Damage to the air flow sensor can shut your engine down. There are a variety of things that can damage or destroy the air flow sensor.
Automobile engines work in a dirty environment with high temperatures and lots of vibrations. The air coming into an engine can contain dirt, sand and even pebbles or road debris. Any of these objects hitting the air flow sensor at high speed and at just the right angle can damage the air flow sensor. Depending on the extent of the damage, the engine could shut down, the car could fail to start or you could get a "check engine" warning light. Some brands of air flow sensors (such as Denso) have started building a sharp turn into the sensor intake to prevent dirt damage to the sensor. This has a problem of its own--it can become clogged with dirt and cut down on the air flow, which reduces engine performance.
Oil can get into the air flow meter (the housing that contains the air flow sensor) in a number of ways. If there is an oil leak, it can splash into the air flow meter. If the leak is in just the right place, there can be a steady stream of oil into the sensor housing. Some models of air filters come packaged in oil or an oil-soaked wrapping. It is not unusual to have problems with the air flow sensor after changing the air filter. Oil is definitely the enemy of an air flow sensor--it is the first thing you should think about when you see the "check engine" warning light.
In northern cities, where the roads are salted in the winter time, grains of salt can get into the air flow meter. A single grain of undissolved salt can damage the air flow sensor. Salt is not necessarily more dangerous than sand, but unless you drive on the beach, you will be driving over more salt than sand. Salt damage can be quickly accumulated, so it can shut the engine down without any warning. The entire sensor assembly closes down, if airflow stops when the engine is running, to prevent fires after a crash.