setImmediate and clearImmediate are sort of like setTimeout/clearTimeout, but are supposed to be run after current I/O event callbacks are done.
Basically this is roughly like setTimeout(callback, 0); as a first stab, but should be run *before* and timeout callbacks.
In effect, immediate, timers and ticks from process.nextTick are sort of like 3 separate priorities of timer queues, although at a lower level they have semantic/behavioral differences. ticks are right away and can cause infinite loops. immediate come next chance after I/O events callbacks. Then timers get fired when ready.