Esters are compounds that contribute to the flavour profile of spirits. Esters can create complex flavour profiles and can be detected at very low levels – even as low as in the parts per million.
Many esters have distinctive odours that are specific to them. Acetic acid esters have the glue/pear smell familiar with Grappa. Lactic acid esters smell fruity (soft, mild, creamy) and are prominent in spirits like Scotch and Bourbon. Butyric acid esters smell fruity (tropical fruits, bubblegum) to create quintessential Rum flavours. As many occur naturally in the essential oils of plants, Gin is packed with them too.
Esters can also introduce flavours of ingredients that are not actually present in the distillation process (which is why you can have rum or whisky that smells like bananas, cloves, etc). The production of specific esters can be encouraged or discouraged by changing either the conditions and materials used in the fermenting, the process or apparatus used when distilling, and the aging processes.