One of those reasons is the presence of predators. If predators also live where the vegetation happens to be best, a herbivore has to strike a balance between the quality of the food and the risk of getting eaten. But a herbivore also has to worry about... other herbivores.
If you eat exactly the same thing as some other animal, and try to do so in the same place, whichever one of you is even marginally better at it is going to, over a sufficiently long period of time, out-compete the other one and drive it to at least local extinction. We see this, for example, in England, where grey squirrels introduced from North America have out-competed the red squirrels native to the island. There are only a few places left in England where you can still see red squirrels, but the foreign grey squirrels are quite common.
To avoid this fate, a herbivore has basically two choices. One is to move somewhere else, where the other animal is at a disadvantage, and won't follow you. The food may not be so good, but at least it's all yours, and, given enough time, you can adapt to the new habitat if you have to. Red squirrels, for instance, are under far less threat in Scotland, where the grey squirrels are apparently less keen on the weather. (Back home in America, they inhabit only the southernmost parts of Canada).
The second option is to eat something different. Two herbivores can, after all, easily share the same place if they don't happen to be eating the same thing. There may well be some overlap, but so long as one of you has something they're good at that the other isn't, you should both be all right in the long term. To take an extreme example, both mice and deer are herbivores, but they have radically different lifestyles and can happily live together in the same forest.
However, there are plenty of examples where two apparently similar animals live in the same area. Of course, this could be a temporary situation where one has not yet had the chance to oust the other. Or we could be talking about a border region where two populations from different areas mix, without either ever getting the upper hand for long. Northern England and southern Scotland, for instance, have both red and grey squirrels.
But in other instances, it's rather less obvious what's going on. Most likely, one of the animals is doing something sufficiently different from the other to enable both to co-exist, but it's not always apparent what that is. One such case is that of the puku (Kobus vardonii) and the lechwe (Kobus leche).
These are both species of marsh antelope native to southern Africa, and, as their scientific names suggest, they're quite closely related. Both live, broadly speaking, in and around Zambia, where they inhabit waterlogged terrain and feed predominantly on marshland grasses. There are plenty of areas where only one is found, with puku inhabiting more easterly lands, such as Malawi and Tanzania, and lechwe being found further to the west and south. But there are, nonetheless, no shortage of places where there are both.
One such place are the Chobe Floodplains along the Cuando River in northern Botswana. Very northern Botswana, in fact, because this stretch of the river forms the border between Botswana and the Caprivi Strip of Namibia. (The Caprivi Strip, incidentally, dates from the colonial period, and exists to give Namibia access to the Zambesi, of which the Cuando is a tributary).
For twelve months, researchers followed puku and lechwe in the floodplains, seeing what they ate, how nutritious it was, and where they found it. They wanted to know, not just how the two species managed to survive together without one pinching all the food, but whether or not things changed over the course of the year. This part of Africa doesn't really have a summer and winter of the sort we'd be familiar with in Europe or most of North America, since the "winter" temperature is still about 27°C (80°F), and is barely less than that in summer. It does, however, have distinct wet and dry seasons, with the rains coming mainly between October and April.
For most African animals, the dry season is the tough one to get through. There are less fresh plants around, after all. You might expect that this would be even more true for animals that are, after all, marsh antelopes, and really like a lot of water about. But when the researchers examined the dung of these two antelopes, there seemed to be no loss of nutrients in their diet at any time of the year; in that respect, they really didn't care whether it was rainy or not.
That's likely because the river is large enough to keep flowing through the dry season, so the soil never really gets all that dry. Higher up, away from the floodplain, other animals were getting hungry, but down near the river, the marsh antelopes were still doing fine. But, as it turned out, there was another problem, and the two species dealt with that with different strategies, which may explain why they can live alongside one another.
In fact, it was the wet season, not the dry one, that was an issue for them. That's because, when the rains come, the river rises and... well, they are on a floodplain. Perhaps the food is just as nutritious, maybe even more so, but that's not much help if it's underwater. The animals were faced with two choices, and, in general, each species favoured a different one: the lechwe crowded onto whatever dry land remained in the flooded valley, while the puku headed up to the savannah plains away from the river.
The lechwe probably got the better end of this deal, but that problem of two species eating the same thing is only going to get worse if they're having to squeeze together onto the same muddy islands. Something had to give, and the lechwe, being the larger of the two, likely came out on top. In fact, we see the same thing with two other marsh antelopes further north in Benin, with the more numerous kob crowding out waterbucks from their mutual habitat.
It's not just good for lechwe because they control the food on the marshy islands. Staying on the floodplains helps them against predators, too. Being out in the open means that they can see lions and other predators coming from a long distance away, something that antelope are understandably keen on. Moreover, when they do spot a predator, the first response of lechwe is to dash out into shallow water where they're unlikely to be followed - so it helps if there's plenty of it about. Not only that, but because most other local herbivores, such as zebra and impala, aren't keen on standing around in soaking wet mud, predators are less likely to go looking for food on the floodplains during the rainy season anyway.
So it's good to be a lechwe when it rains. But isn't this exactly the sort of thing that ought to, over time, drive the puku to local extinction? Well, perhaps it has in other places nearby, which would explain why you don't find puku any further south than this. For that matter, there are less puku in this area than there are lechwe, something that's not true in slightly different habitats further east. But the puku do have an advantage of their own: they quite like to eat savannah grasses.
So, come the rains, they nip up to higher pastures, away from the lechwe, and manage to do all right for themselves. When the rains stop and the waters retreat, it's back down into the valley, but that extra time, with different food, during the wet season prevents the lechwe from having enough of an edge to drive them out permanently.
It's probably not an ideal situation for the puku, who do rather better in other parts of Africa. But it's enough, and that's what matters.
[Photo by Hans Hillewaert, from Wikimedia Commons]