Nectar is the staple of a butterfly's diet. In the plant world, nectar is a reward for animals that act as pollinators, including butterflies and bees. Flowering plants produce nectar that the insects want to eat, and in exchange the insects spread the flowers' pollen, allowing them to reproduce. While some insects, like bees, have lots of adaptations that allow them to carry lots of flowers, many butterflies don't. In fact, some butterflies don't spread pollen at all -- they take the nectar without helping the plant in exchange. In this sense, butterflies can be parasites.
It's easy to imagine butterflies as delicate insects flitting from flower to flower in search of nectar. Their long proboscis allows them to reach deep into flowers and retrieve the nectar found there. At first glance, the proboscis doesn't seem suited to consuming any other type of food. While it's true that sugary nectar is a primary source of energy for butterflies, they have lots of other dietary needs. Butterflies need nutrients and minerals to fly and reproduce, and many of these don't exist in the sweet liquids produced by flowers.
Some butterflies also eat fruit. Some of these butterflies pierce the fruit's skin and drain the juices from inside. Others drink the juices from the surface of rotting fruit. Butterflies that prefer to drink from fresh fruit sometimes have a pointed proboscis, making it easier to puncture the fruit's skin.
Getting enough minerals and salt requires other food sources, including urine, dung and standing water. This is why you'll often see many butterflies drinking from very shallow, still water. This water has absorbed minerals from the soil underneath it, and the butterflies need these minerals to supplement their diet. This behavior is called puddling. Sometimes, butterflies will fly away from a puddle and return to it a few seconds later -- this may disturb the water, bringing more minerals to the surface. If there's no water around, a butterfly may regurgitate into the soil and then drink in the hope of retrieving minerals.
All of these behaviors lead up to the main purpose of a butterfly's life -- reproduction. Read on to learn about mating rituals and how male butterflies contribute to females' ability to lay eggs.