Plants produce nectar to attract pollinators in the case of floral nectar (FN) and defenders in the case of extrafloral nectar (EFN). Whereas nectars must function in the context of plant-animal mutualisms, their chemical composition makes them also attractive for non-mutualistic, exploiting organisms: nectar robbers and nectar-infesting microorganisms. We reviewed the chemical composition of both FNs and EFNs and found that nectar composition appears tailored to fulfil these ambivalent roles. Carbohydrates and amino acids usually function in the attraction of mutualists and appear adapted to the physiological needs of the respective mutualists. Volatiles are a further group of compounds that serves in the attractive function of nectars. By contrast, secondary compounds such as alkaloids and phenols serve the protection from nectar robbers, and most nectar proteins that have been characterised to date protect FN and EFN from microbial infestation. Nectar components serve both in attraction and the protection of nectar.