Shaving cream is placed into a vacuum chamber, then the vacuum is turned on. The chemicals are arranged such that there are many pockets of air trapped inside the shaving cream. The air pockets in shaving cream will expand in a vacuum. As the pressure gradually decreases the volume of the shaving cream get bigger and eventually fills the jar. This is a great example of Boyle's Law which shows an indirect relationship between pressure and volume.