One of dispersion systems.
Gas disperses in liquid, and forms a number of bubbles, the bubbles are divided by continuous liquid. Gas is dispersed phase, liquid is dispersed medium. Foam is thermodynamically unstable.
Dispersed medium may be water or other liquids, whether or not the liquids are compatible with water.
A pure liquid can not form a foam system. For example: pure water.
May use a simple way to verify:
Distilled water (may be considered as pure water) is bottled, severely shocks. After water is still, we can see that foam system is not formed.