Expanding foam is a product which is designed to expand and harden upon contact with the air.
Classically, expanding foam is stored under high pressure. When a user activates the spray nozzle, the pressurized contents spurt out, and they start to expand, that's expanding foam. Expanding foam can grow exponentially in size, which means that people need to be careful not to apply too much. Latex, polyurethane, and a variety of other materials can serve as a base for expanding foam, and waterproof, fire resistant, and other specialty versions are available.