How does update.zip work?
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.