UV-curables belong to a class of adhesives which "cure" or change from liquid to solid by a chemical reaction called cross-linking. In UV-curables, the reaction is photochemical: the liquid chemicals which form the adhesive receive the activation energy needed to trigger the crosslinking reaction from photons of light. By artful design of the chemistry, the photon energy needed to promote the reaction is moved into the UV range, where ordinary visible light will not activate the glue.
These glues generally contain a mix of liquid polymer resins which crosslink with each other when exposed to UV. They are usually blended with another component called a photochemical promoter; when struck by UV light, the promoter degrades into free radicals which then boost the reaction in the resins to speed up the cure and increase the strength of the cured glue.
Other chemistries are possible, and the photochemical component is often a cocktail of promoters and other ancillary chemicals which increase the sensitivity of the promoter to UV light or modify the reaction chemistry in specific ways to get the best cure.