Male Asian elephants have tusks; females don't. Peahens are drab and brown, while the male peacocks are a riot of iridescent color. Male bighorn sheep run into one another headfirst at full speed; ewes don't behave that way. What is going on here?
"Sexual dimorphism" is the term for any variation between the two sexes within a species. Females and males can differ in color, size, shape, behavior, ornamentation, and even immunity to disease. Why does nature so often use two different blueprints for the same kind of animal?
Selection is the most common reason for dimorphism. This is especially true among birds, where brightly colored and noisy males are often paired with mousy, quiet females. During mating season, the prettiest and loudest guy gets the girls. I say "girls," plural, because strongly dimorphic species like peacocks, lyrebirds, and even ducks tend to be polygamous. The males need to mate with as many females as possible each mating season, to ensure that their genes will be passed along. Since the males tend to stand out in a crowd, they are easy targets for predators. Over the ages, peahens have been impressed with those males who could sport a colorful 3-foot tail and still survive until mating season! Those traits, flashy but tough, get passed down to the next generation.
Sexual selection is also the reason for dimorphism in mammals such as sheep, deer, and antelope. Males expend energy to grow elaborate horns or antlers, so that they can fight other males for the privilege of mating. If the males are healthy and strong enough to invest in a large body and impressive head-gear, they will win and leave offspring. This tends to improve the species over time, and encourages even more dimorphism. Male Irish Elk, an extinct deer, had horns that weighed 90 pounds and could reach 12 feet from tip to tip! They were the mammalian equivalent of a peacock, burdened with an attractive but heavy handicap.
The flip side of male birds' flashy coloring is the somber dress of the females. This is particularly the case for ground-nesters, as well as small-bodied species. These females would be very vulnerable to predators while sitting on the nest if they were colorful, so they have been selected to blend in as much as possible.
Some species develop different male and female forms so that the two sexes don't have to compete with one another for food. In some hummingbird couples, the beak of the male is considerably longer than the female's. This allows the two birds to feed on different kinds of flowers, so they don't have to share scarce nectar. In many predatory birds such as eagles and hawks the two genders look much alike, but the female is about 30% larger than her mate. She can take larger game, such as hares or big salmon, while the male concentrates his hunting on smaller animals.
Finally, some deep sea fish have had to adopt extreme forms of sexual dimorphism because it's so hard for them to find another member of their species! One example is an anglerfish called the Triplewart seadevil. (Maybe they would have better luck if they changed their name...) These fish live at incredible depths, where food is very scarce. If there isn't much food, there can't be too many fish either. So, when a male and female seadevil happen to encounter each other in the abyssal blackness, the much-smaller male attaches himself to the female's stomach permanently. He then degenerates into a sperm-filled sack, a sort of parasitic testicle. Whenever the female is ready to generate eggs, she has a handy fertilizer right there, waiting!
The more flamboyant forms of sexual dimorphism look counter-productive to us. Do male lyrebirds want to get eaten? Why does a deer grow big antlers, just to let them drop off and start all over again next year? However, these traits are important enough in the competition for mates to make up for the inconvenience and wasted energy. Otherwise, lyrebirds and deer would be extinct by now!