The oxygen in air quickly causes coffee to deteriorate and lose its aroma. In order to prevent this, the following packaging techniques are used:
All the air in the pack is removed. This causes the contents of the pack to form a hard, compact mass, hence the trade term of "hard pack".
Vacuum packaging in a protective atmosphere
The contents ar packed in a process known as Modified Atmosphere Packaging, or MAP. The coffee remains loose and the package feels normal to the touch, hence the term "soft pack".
Freshly-roasted coffee beans produce carbon dioxide. A small valve allows this to escape, while preventing the entry of oxygen.