We are talking mainly about bovids (cattle and antelope), which grow horns over their lifetime, and deer, which grow antlers every year. In most well known bovids and cervids, only the males grow the horns or antlers, but there are a few species where the females do as well.
For example, male and female cattle (including the many wild versions such as the African Cape Buffalo) and wildebeest (a kind of antelope) have horns, while in most other bovids only the males have horns. Both male and female caribou (a kind of deer) grow antlers each year, while in most other deer only the males do so.
This is actually a very complicated issue, and a new study of this question offers a new possible answer. But first, what did we think before this study?
There is one factor that explains most instances of female horns or antlers. The tiny monogamous deer and antelope tend to be much more "monomorphic" (that is, males and females look similar) than larger deer and antelope. These are small, pair-bonded, forest-dwelling species, and their horns or antlers are effective tools for defending territory or defending the young against small forest predators such as cats. Both the males and females have the horn or antler because they both use them, and for similar purposes. That is not particularly enigmatic.
It is also not hard to explain why in the vast majority of large cattle, antelope and deer species males and females are dimorphic (that is, males and females look different) in this trait, with only the males having the big appendages on their heads. In most of these species, males compete with each other, either in direct male-male competition or using a more show-off strategy to impress the females, in which the horns or antlers play an important role.
What's harder to explain is this: In a small number of these large species, where the males compete over females, why do females also grow horns or antlers?
One early theory suggested that females in larger species could use these appendages for anti-predator defense. In other, smaller, species the females are better off hiding or running away. In my personal experience with wild Cape buffalo, this makes sense. On many occasions while working in the Semliki Valley in the Congo, I encountered small herds of female buffalo with their young. As I would draw nearer in my vehicle, they would gather more closely and form a circle with the young in the center, watching me suspiciously and looking rather formidable, and the horns were very much part of that look. However, this does not seem to hold true for deer. In the largest deer species, females do not have antlers.
Another previous hypothesis, proposed by Richard Estes, who works with wildebeest in East Africa, suggests that horned or antlered females benefit by confusing adult males as to who the young males in the group are. This is a strategy to keep the young males in the group longer, so they can grow bigger before heading out on their own. Essentially, this is a trait that benefits mom (it makes her son more successful) but is manifest in her daughters. According to this idea, female horns or antlers should be found in species where competitive males are forced to hang around with each other more than in other species because they live in large herds that consist of "family" groups. This is, in fact, what is found in caribou and wildebeest, two of the prime example of antlered or horned females.
The new theory, proposed by Ted Stankowich of the University of Massachusetts and Tim Caro of the University of California at Davis, is that females benefit from having horns or antlers if they are of a body size or live in a habitat that makes it hard for them to hide. The more conspicuous the female, the more benefit they gain from horns or antlers, which would be needed for defense against predators. (They may also benefit from competition with members of their own species for grazing spots.) This would explain caribou and wildebeest nicely, as they both live in very open country, as well as a lot of other species. This study was done by looking at a large sample of animals for traits related to body size and vegetation cover in the habitats they live in. The sample included 82 species with female horns or antlers, of which 80 were “very conspicuous.” According to the authors, who feel the two species that did not fit for reasons that can probably be explained, that is a nearly perfect match between theory and data.
More information on this story can be found here.