This from Wikipedia...
In an Engine Management System (EMS), electronics control fuel delivery, ignition timing and firing order.
Primary sensors on the system are engine angle (crank or Top Dead Center (TDC) position), airflow into the engine and throttle demand position.
The circuitry determines which cylinder needs fuel and how much, opens the requisite injector to deliver it, then causes a spark at the right moment to burn it.
Peccavi
March 2010