Pectins are long-chain sugars that are found in the cell walls of plants, most especially in the walls of fruit cells. There they create a sort of elastic, moisture-retaining barrier and also function as a glue that holds the cells together. Pectins are especially abundant just before fruits are at peak ripeness. When fruit is cut up and/or mashed and then immersed in hot water the pectins come loose, dissolve and disperse. Under the right conditions those sugars can be brought back together into a flow-preventing network, but it takes a little coaxing since pectins repel each other in pure water. Acid generally does the trick as it changes the molecules’ polarity and encourages them to bond.
Pectin is most often used as a thickener for jams since a.) it’s already there to begin with and b.) a fruit mash for a jam is usually acidic, and if it isn’t naturally it’s made so with the addition of lemon juice. Jam works by gently boiling the fruit in a heavy syrup to dislodge and dissolve the pectins. At the same time the sugar in the mixture binds up a good deal of the water thus putting the pectins in closer proximity. When the syrup is thick enough acid is added and the gel shortly forms. The finished jam is then cooled and allowed to set.
Here it’s important to point out that pectin can’t take a whole lot of heat AND acidity in concert. If the boiling goes on longer than a few minutes the pectins start to break into pieces, the flow-inhibiting network breaks down and the jam thins out again. This is why traditional jam-making can be difficult, at least when it comes to judging when the syrup is thick enough and/or when the gel has formed. Too much boiling past the gelling point and you get fruit syrup. Which is still darn good.
Is jam the only thing pectin is good for? No, but because it requires both acid and heat to activate — plus a fairly high concentration — it’s not as useful as many other commonly available thickeners.