Notice how the male is smaller than the female. When he first grabbed her she scrabbled in the air with her legs, trying to get purchase on the branch, then after a while she tucked her legs up to her body. Sometimes they fly around like this, with the male flying and taking all their weight.
Butterflies reproduce the way other creatures do -- sperm from a male fertilizes eggs from a female. Males and females of the same species recognize one another by the size, color, shape and vein structure of the wings, all of which are species specific. Butterflies also recognize each other through pheromones, or scents. During mating, the male uses clasping organs on its abdomen to grasp the female.
Many male butterflies deliver more than just sperm to their mates. Most provide a spermatophore, a package of sperm and nutrients the female needs to produce and lay eggs. Some males collect specific nutrients to produce a better spermatophore in an attempt to attract a mate.
The female stores the sperm in a sac called a bursa until she's ready to lay her eggs. She fertilizes her eggs as she lays them, using the last sperm she received first. For this reason, males of some species will also leave a substance that dries into a film on the female's abdomen, in an effort to keep her from mating with other males.
Ref: How Stuff Works