Hi boba,
atmospheric pression at low altitude (sea level) is a huge force per area (~ 1 Kg / cm2). So, even if molecules have a big energy (thanks to ambiant temperature), they are not powerful enough to fight against this force. But when pression vanishes, ambiant temperature is large enought to make molecules leave the little pot and get vaporized. It is the same phenomenon that explains why water boils at less than 100°C (212 °F) in the mountains or in any low pressure spaces.
Some molecules keep connexions with their neighboors and finally encompass some air, creating bubbles. We can guess that gel molecules are something like "amphiphilic" like soap, which means that they have one side of the molecule which is hydrophilic and the other which is hydrophobic and thus being able to create a thin surface that will enclose air.