When the engine is cold, the engine does not run as well, so it counteracts this by running at higher RPM to avoid stalling.
The main issue is fuel vaporization. Fuel vaporizes at 196*F (91*c). Unvaporized (liquid) fuel does not burn. To keep the engine running while cold, the ECU adds in extra fuel. On carburetor engines, they used a choke. The rich mixture requires ignition timing to be restarted. This causes the engine to make less power. The higher idle allows the engine to run while the air fuel mixture and timing are less than optimal.
On the car with the idle that was going up and down, the ECU was likely trying to calibrate the inputs and output to get the idle where it needs to be. There is a small solenoid in the throttle body that allows air through to raise the RPM while the engine is cold.
Another issue is that your sensors may be out of range or not working while the engine is cold. The oxygen sensor needs to heat up before it can start working. Until the oxygen sensor is ready, your ECU is in a open loop state and must guess how much fuel to add. This can cause an up and down in idle.