All air is vacuum-evacuated from both the battery and board compartments while the potting compound sets. Once the wiring is finished and tucked-in neatly, the entire assembly is potted the same way.
Since no air or very little air remains, the assembly is rendered incompressible.