How it works
There are many types of adhesives and different materials change the nature of the adhesive, so I will cover the main way glue works. First, a good glue must start out as a liquid with a low surface tension to allow it to spread quickly, and then it must cure into a solid which must bond two surfaces together. Exactly how this bond occurs is much debated. Here are four common theories.
Mechanical Theory
   This theory is that strands of molecules of glue become entangled irregularities in the surfaces causing things to stick.
Adsorption Theory
   This theory states that glue molecules "stick" because of covalent bonds and/or acid-base interactions
Electrostatic Theory
   This theory involves Van Der Waal's forces.Van Der Waal's forces are the strange forces that theorecticaly would allow non-polar molecules to bond.
Diffusion Theory
     The Diffusion theory is that the glue actually overlaps and merges with the first hundred molecules of the surface it is bonding to.
Turning Liquid into Solid
    
How do do you make a glue that turns from a liquid into a solid once the glue is in place? It's not always a simple case of air drying. There are three main methods used, solvent evaporation, freezing and polymerization. Solvent evaporation is exactly what it sounds like. Freezing is also very simple, a solid is heated up, applied and then freezes forming a solid. Glues that use the freezing method are called hot-melts. Animal glues often work this way. Polymerization is more complicated matter.A basic definition is: monomers in a chemical reaction form high molecular mass molecules. In other words, a simple compound within a glue reacts with some kind of catalyst and starts linking together, eventually forming a solid.
For information on polymerization click here
Superglue at work in the industry