you basically want to know how the ecu works?
very simply, it stores some tables, commonly known as maps. for example, one basic map is for the fuelling. if you imagine a table (not a bloody dinner table) with, for example engine speed across the top making the columns, and engine load down the side making the rows. something like this:
so, depending on the load on the engine (in this case measured by the voltage output from the MAP sensor), and the speed, the ecu looks up in the map how long to open the fuel injectors. simple.
you will also have a map for the ignition timing, and other maps to take account of air and coolant temperature etc.
there's a fantastic thread that goes into more detail posted by Stu. do a search. if you're really interested, buy a book from Haynes written by dave walker called engine management or something.