Bisphenol A
The manufacture of epoxy resin begins with bisphenol A, a white, crystalline substance widely used in the manufacture of polycarbonate plastic. In the presence of a base, it reacts with another chemical, a colorless liquid called epichlorohydrin. This reaction forms oligomers, short chains of a few subunits. Each end of the oligomer has an epoxide group on it. Epoxides are three-membered rings made from two carbon atoms and an oxygen atom. The products of the reaction between bisphenol A and epichlorohydrin are the materials sold as epoxy resin.
Hardener
Several compounds are used as hardeners. They all have the same basic features: they are short-chain molecules with two amine groups on either end of them (and often a couple more amine groups in the molecule as well). An amine is a nitrogen atom attached to at least one carbon atom; it's a little like a molecule of ammonia where at least one of the hydrogens has been replaced by a carbon chain.
Reaction
The nitrogen in an amine group that is relatively electron-rich and can act as a base, meaning it wants to donate two of its electrons to form a bond. When you mix the resin and the hardener, the nitrogens in the amines attack the epoxide groups, breaking open the three-membered ring. Since each molecule of hardener contains multiple amine groups, it can bond to multiple oligomers from the resin.
Results
The end product of this reaction is epoxy, a series of long chains cross-linked to each other in a strong, sturdy matrix. The cross-linking between chains makes epoxy very durable and resistant to chemical attack, and because it contains alcohol groups (an oxygen atom attached to a hydrogen atom), it can bond with molecules in surfaces like glass and wood, making it all the more useful for repairs.