The mass airflow (MAF) sensor measures how much air the engine is breathing. Without an accurate MAF reading the computer can't fuel correctly, which causes poor performance, hesitation, and bad fuel economy. Try cleaning the sensor with MAF-safe cleaner before replacing it.
Causes are listed roughly in order of how often they're seen on Canadian independent-shop tickets. Always confirm with a scan-tool freeze-frame and a circuit/sensor check before replacing parts.