A MAF sensor does as its name suggests. It’s a device in the air intake system that measures exactly how much air, by mass, is entering in the engine.
Its signal is fed into the ECU, which also reads the signals from the sensors for air temperature and water temperature, engine speed and other factors. From these figures, it will look up, in a series of pre-set and pre-stored 2D and 3D maps, what amount of fuel needs to be injected and when, it will then deliver the required amount of fuel.
A MAF sensor is a very accurate measure of the air entering an engine, but its also a relatively slow-reacting one, since it needs to measure the air flow where it is located and send the information back to the ECU.
Therefore there can be a slight delay between the driver snapping throttle open and the increase in airflow being registered. However, most systems have something known as transient compensation, which is a safeguard built in to deal with this.
Other systems rely on different parameters to determine the amount of fuel required. For example, a system based on throttle position and engine speed will know if the car is accelerating hard (full throttle, mid to high rpm) and give lots of fuel accordingly. Alternatively, if the engine rpm is low to mid and the throttle has a part opening, it knows the car’s probably cruising and leans off the fuelling.
The throttle position can be determined from the TPS (Throttle Position Sensor), which is fixed to the throttle plate on the throttle body. The TPS is usually a potentiometer type (a variable resistor), effectively supplying a gradually increasing supply of voltage to the ECU as the throttle is gradually opened.