This isn't, strictly speaking, a home repair question but someone here will likely know.
On those commercial restroom hand soap dispensers, the ones where you pull or push a lever and instead of getting an amount of liquid soap you get a blob of foam, what makes the foam? What gas is in the tiny micro bubbles, air? It's liquid in the container so how is it turned into foam? Can you make liquid into foam just by forcing it through a nozzle?