Pack is the other way round. It puts the selected layers into one precomp, like After Effects’ Pre-compose with every attribute moved into the new comp, but trimmed to just the time the layers use.
Pack the selection
Select the layers in the timeline and move the pointer over Pack.
The count reads how many layers go in and that one comes out, such as 8 → 1. Click Pack.
The layers are replaced by one precomp layer, named after the top selected layer with Pack on the end, such as Palms Pack. It's selected, ready to move or eject again.
The new precomp starts where the first layer started and ends where the last one ended, so it holds no empty time. Its layers keep their timing inside it, and the precomp layer sits at the same moment in your comp, so nothing moves in time.
A selected layer whose parent wasn’t selected loses that parent before it goes in, since the parent stays behind in your comp.
Crop it to the layers
By default the new precomp is the size of your comp. Hold Cmd (Ctrl on Windows) to size it to the layers instead.
Hold Cmd over Pack and crop marks frame its cards. The hint reads Sized to the layers, nothing moves.
Cmd-click. Eject measures where the layers reach over their whole time and sizes the precomp to that box, then places it so every layer stays exactly where it was on screen.
If there’s nothing to measure, such as a selection of only nulls, cameras or lights, the precomp is packed at the comp’s size and the message says nothing to crop.
Each Pack is one step in Edit → Undo, named Eject: Pack.