You remember those art and craft classes in school? Glue used to be the most important thing there. Well, even today it is being largely used, though surely it has modified over the years.
Also, there are glues that contain special solvents that keep the molecules of the glue away from each other. The solvent can evaporate in a half empty bottle but because of the limited space, it doesn’t and hence the glue does not stick inside its bottle!