Zebras contrary to popular belief aren't all black and white. Most of them in fact have a brownish tinge to their stripes, and the the shades of their colors vary dependent on where they natively come from as well. The stripes as we all know are an evolutionary way of avoiding predators by making them blend into their backgrounds.
The question you might ask when told this is what is there thats black and white in the African plains or them to hide against?. Well the answer is that there really isn't anything with those specific colors. However a lot of the larger predators cant perceive colors that well, and a lot of them in fact see only in black and white. This means that the zebra can blend in amongst not only grasses and taller plants. But it can hide itself in the shady patches beside trees as well, and not be easily visible to predators.
The secondary effect of this is that a predator seeing several zebras moving together what can only see in black and white. Such as the lion, will find it difficult to pick out a single animal to hunt down, and may even perceive the herd as a single mass moving across the plain. It is generally only when zebras are spaced out whilst feeding that they are targeted by predators.
Zebras themselves are from the horse family, and are in fact very similar to normal horses in most respects. Some of them were even tamed and ridden when they were first discovered. The stripes are no doubt an evolutionary development from having lived in plains and grasslands for millions of years. Horses started out as very small versions of what they are today. As they grew larger there were more and more predators who could see them now that they were above the grass line. The horses who had slowly spread out to different areas became what we know as horses today. And the horses in Africa and inhabiting plains areas because zebras.
There are actually three separate species of zebra, as well as numerous sub species as well. The zebras you will probably have seen on TV or in zoos are the common plains zebras. These are the largest and have the famous striped pattern. A lot of the other sub species however have very different patterns than this because of their different surroundings. The Equus grevyi species for example has very close together and uniform stripes almost like a bar-code. Whereas the plains species have more spread out patterning.