I don't know what the stock ECU does, but my ECU uses the engine RPM and the MAP vacuum value to determin how much ignition advance to use. Also when the coolant it cold, there is a user-mappable addition of ignition timing to aid cold running, and when the AIR TEMP goes high we can map in a retard of ignition timing to prevent detonation.
When mapping throttle bodies, the above applies, but TPS is used instead.
Andy