For a plant, nectar is something like a political campaign contribution.
When an individual or organization gives money to a politician, it often appears to be a simple gift, no strings attached. Of course it’s rarely that simple. Whoever gives the money is usually hoping for something in return, a favorable law perhaps.
Flowering plants make sweet nectar only to give it away freely to passing insects or birds. This isn’t simple altruism, though. Like a campaign contributor, the plants expect to get something in return. Insects and birds help the plants reproduce in exchange for their free nectar lunch, carrying the plants’ pollen or seeds.
This brings us to the mystery of the ferns. Ferns don’t have flowers, and they don’t need anyone’s help reproducing. However, some species of fern still make nectar which ants come and sip.
As it turns out, this isn’t simple altruism either. Think of it as a kind of insurance policy. Ferns tend to produce this nectar only when the leaves are young, before they have even started making spores for reproduction. This nectar is especially delicious to ants, which climb the ferns and often line up on the fronds to sip. A recent study has shown that a fern crowded with nectar sipping ants is less attractive to leaf eating insects than a fern with no ants on it. The ants don’t harm or help the fern directly in any way, but their presence indirectly keeps more dangerous insects at bay.