The image is garbage collected during delivery. The garbage collector locates any unreferenced objects and frees the space they occupy. Then Delivery compacts the remaining memory so that the saved image is smaller.
Garbage collection is a generally good method of trimming the image size at delivery time. However, it is general too conservative, and so it has no effect on a significant portion of the Common Lisp system and your application: Interned symbols, class definitions, and methods discriminating on classes. Such objects must be dealt with by the treeshaker.