Foam is a substance that is formed by trapping pockets of gas in a liquid or solid. It is a type of colloid, which is a mixture in which one substance is dispersed evenly throughout another.
Foam can be formed in several ways. It can be created by agitating a liquid to introduce air into it, such as when you shake a bottle of soap to produce bubbles. Foam can also be formed when a gas is released from a liquid as a result of a chemical reaction, such as when yeast produces carbon dioxide gas in bread dough.
There are different types of foam, including solid foams like Styrofoam and foam rubber, as well as liquid foams like shaving cream and whipped cream. Foam can also be classified as either stable or unstable, depending on how long it retains its structure.
Foam has many practical applications. It is used in insulation, packaging, firefighting, food preparation, and even in the production of materials like mattresses and seat cushions.