Official factory image downloads for Pixel and similar devices don't hand you a single flashable file — they're a ZIP containing a nested ZIP of individual partition images (boot, system, vendor, and more) plus a script that flashes all of them in the correct order. Understanding what that script actually does, rather than just running it blindly, matters when something goes wrong partway through.
Extracting a factory image gives you a folder containing flash-all.bat (Windows) and flash-all.sh (macOS/Linux), a bootloader-*.img, a radio-*.img, and a nested ZIP such as image-devicename-buildid.zip holding the actual partition images: boot.img, system.img, vendor.img, vbmeta.img, and others depending on the device's partition layout. The flash-all script doesn't flash from that nested ZIP directly with individual fastboot flash commands; instead it typically calls fastboot update image-devicename-buildid.zip, which reads the ZIP's internal android-info.txt to confirm compatibility and flashes every partition inside it in one pass.
fastboot update (or fastboot flashall depending on script version) against the nested image ZIP, which flashes boot, system, vendor, product, and the remaining partitions together.This staged order — bootloader first, then radio, then the rest — exists because some devices need the current bootloader version active before they'll accept later partition images correctly; skipping straight to the main image flash on an outdated bootloader can produce flashing errors that look unrelated to the actual cause.
By default, the flash-all script wipes user data as part of the process — it's built assuming a factory reset is wanted, which is the normal case when installing a new firmware version. If you need to preserve app data and files, edit the script (or pass the equivalent flag manually) to remove -w from the command line before running it; without that edit, you will lose everything on the device the moment the script reaches that step, with no undo.
Manually flashing partition-by-partition with individual fastboot flash boot boot.img, fastboot flash vendor vendor.img commands (covered in the general stock ROM flashing guide) gives you fine control: you can flash only the partitions that changed, skip a wipe more easily, or recover from a single failed partition without restarting the whole sequence. The flash-all script trades that control for speed and lower error rates on a full, clean firmware install — it's the better choice when you're doing a complete factory image restore and don't need to preserve or selectively update anything.
If flash-all errors out mid-sequence — commonly on the bootloader or radio step with a version mismatch message — don't restart from the top blindly. Check fastboot getvar all (see the getvar reference guide) to confirm which bootloader and radio versions are actually active on the device right now, since a script that fails after successfully flashing the bootloader but before finishing the main image leaves the device in a valid intermediate state, not a broken one. Re-running the full script from that point is normally safe; it simply re-flashes the bootloader and radio again before proceeding, which doesn't hurt anything.
Some custom ROM projects and enthusiast communities distribute their own flash-all-style scripts modeled on Google's, adapted to a given device's partition layout. The underlying principle transfers directly — bootloader and radio first with reboots between steps, main image last — but the actual partition names and count vary enormously by chipset and OEM, so a script written for one device family should never be pointed at a different one even if the commands look similar.