How does Styrofoam work?
Styrofoam is a rigid foam consisting of gas trapped in the closed bubbles of polystyrene. Polystyrene itself is a clear plastic that’s used in many disposable food containers. It’s a stiff, amorphous solid at temperatures below 100° C, where amorphous means that it has none of the long-range order associated with crystalline solids. The long, chain-like polystyrene molecules are arranged like a tangled bowl of spaghetti noodles. Amorphous plastics tend to be clear because they’re very homogeneous (uniform) internally and let light passes through them without being deflected or reflected. Plastics that are partially crystalline tend to be white. I think that items bearing the #5 recycling label are made of polystyrene.
But when air or another gas is injected into melted polystyrene and the mixture is beaten to a froth, it forms a stiff white solid when it cools. The whiteness comes about because of inhomogenieties—the gas spoils the uniformity of the plastic so that light is deflected and reflected as it passes through the material. The Styrofoam retains the rigidity of the polystyrene plastic below 100° C, so that it’s suitable for beverage containers for liquids that are no hotter than boiling water. At one time, one of the gases used to make polystyrene foams was Freon, but I believe that Freon is no longer used for this purpose.