Older books were often decorated. If you had money up the wazoo, you might have paid for a jeweled binding. Here, precious stones and gilt metal plates were worked into the covers. Sometimes ivory and enamel work were used. These bindings were often the work of silversmiths, goldsmiths and jewelers, rather than bookbinders. Sometimes they are also called treasure bindings, which sounds much more piratical.
More common is tooling. Various metal tools—punches and stamps and rollers—are heated up and pressed into damp leather. When gold metal leaf or foil is pressed into these patterns, it’s called gold tooling. (Other metals or colours were also used). Alone, these patterns are called blind tooling.
The edges of the text block were also decorated. Marbled edges were quite common from the end of the 17th century to the start of the First World War. The text block was clamped and the edges touched to the surface of a liquid on which the swirled colours were floating.
Originally, gilt edges were gilded with actual gold. The edges of the text block were sanded smooth, primed with bole and a dilute solution of gelatin or albumen, covered with gold leaf and burnished. The results were generally better if this was done before the book was bound. It looks pretty and protects the innards of the book from the incursion of dust.
Gauffered edges take the whole gilding thing one step further with patterns impressed into the gilded edge, using heated tools and rollers.
At some point humans were ingenious enough to invent machines to gild and marble the edges of books, which boggles the mind. Gold-coloured foils were used instead of actual gold leaf. Edge gilding machines were apparently particularly popular in the Bible publishing business.
Gold foil may still actually contain some gold (or another metal), but within a plastic film backed with pressure sensitive adhesive. Blocking foils may also contain white and coloured pigments.
Painted edges (or fore edge paintings) are less common but are very cool. Sometimes they can be seen with the book closed; sometimes the pages must be fanned in order to see the image. (In the latter case, the edges of the text block are also marbled or gilded, so that you can’t tell from the outside that a painting lies within). Very clever people occasionally went so far as to paint two scenes: one visible with the pages fanned one way, and the second with them fanned the other. (A double fore edge painting). Abebooks.com has put together a little collection of fore edge paintings here.