How does update.zip work? update.zip s are packages containing replacements for parts of an android system. The packages contain all the files it the update is intended to replace, and a script that will do the replacement when its run. 

Update.zips can come from OTA updates but in some cases it is necessary to manually download and put an update.zip in some special folder. However, the update.zip is still detected and applied in the same manner.

What part of android detects and handles update.zips?
update.zip are never touched by Android.

Inside that archive is a script that is parsed and interpreted by the Recovery runtime.

The Recovery, at execution, opens the archive by unzipping into a temporary directory, reads the script, aptly named update-script, analyzes it, and based on the syntax, executes a function known to Recovery, that function may do the following, to name but a few:


mount /system and other filesystems, and perform read/write file operations  including, copying the kernel, or, an apk or even formatting a partition etc
check the build.prop for certain properties, such as device, manufacturer, etc
print display to the screen, progress information etc


It is pretty much a de-facto standard incorporated into Android Open Source Project (AOSP)

ClockworkMod, TWRP are derivatives of the barebones version that resides in AOSP with additional enhancements, such as touchscreen input.