Although the Mister Ed television show enjoyed a five-year run on CBS in the early 1960s, it was actually one of the very first series to start out in syndication and then be picked up by a network. (Mister Ed premiered as a syndicated show in January 1961, and CBS added it to their prime time schedule the following October.) Without network backing in the beginning, however, the show's budget was extremely tight. During the filming of the pilot episode, production costs mounted as the recalcitrant horse cast as Mister Ed refused to perform on cue (if it performed at all), resulting in large expenditures to cover the costs of additional training fees and wasted footage.
The producers of the show were ready to throw in the towel and write off the venture when one of the putative Mister Ed's trainers came up with a solution: the nearby Jungleland animal park in Thousand Oaks, California, had a trained Grevy's zebra that was being used in live shows for the park's daily tour visitors. The zebra (a female, called "Amelia" by its Jungleland handlers) was trained to perform many of the same actions (e.g., opening and closing its mouth, stamping its feet on cue) required in the Mr. Ed role, and Jungleland consented to lend her out for a few days' filming.
Amelia worked out fantastically well, exceeding everyone's expectations, and the pilot was quickly wrapped up and sold to the syndication market. The producers made a generous donation to Jungleland in exchange for continued use of Amelia, and she appeared in all the syndicated episodes as well as all the shows comprising the series' entire five-year run on CBS. Amelia retired to Jungleland when Mr. Ed was canceled after the 1965-66 season, where she lived for three years before being sold at auction when Jungleland closed in 1969.
The show's premise, of course, called for a talking horse, not a zebra. The producers felt the concept was already absurd enough without stretching credulity by having to explain why someone would have left a zebra (let alone a talking one) at a country house, so they chose not to explain it at all. They stuck with the original premise instead: Mister Ed was always referred to as a "horse," and since the series was filmed in black and white, the viewing audience couldn't tell the difference.
(The difficulty in resolving closely integrated black and white images on non-color television receivers was one of the primary reasons NFL games were not regularly televised until the mid-1960s, when sales of color TV sets started to outstrip those of black-and-white models. When black-and-white television predominated in the nation's living rooms, football games were too often disrupted when players ran into the referees, whose black-and-white striped uniform tops made them nearly invisible to onlookers. Likewise, Johnny Cash's famous televised live concert performance at California's Folsom Prison in January 1968 proved disastrous when several inmates wearing the traditional black and white prisoner's garb slipped unnoticed past guards, who had been provided only black and white monitors with which to view the proceedings.)
[How a zebra appears on color TV, versus how Mister Ed appears on black-and-white TV.]
Zebras are noticeably smaller than horses, so the set used for Mister Ed's stable was constructed using forced perspective (the same technique employed on Disneyland's Main Street) to make it appear larger than it really was (and thus make Mister Ed appear larger than he really was as well). This gimmick also helped to mask the fact that Alan Young, the series' star, was only a diminutive 5'4" tall. Since a zebra's gait is distinctively different than a horse's, the rare episodes that called for scenes of Mister Ed running were filmed in long shots using real horses, a practice which has lead to the mistaken claim (cited in several fan-related publications and web sites) that a zebra was occasionally used on the show as a "stunt double." (In later years a Palomino horse named Bamboo Harvester would often be erroneously identified as having been the Mister Ed, but this horse was in fact only used for promotional appearances and publicity stills; it never actually appeared in the TV series.)
The substitution was an open secret around the industry, however, and continual sly references to zebras were worked into the show. The two most blatant examples were the episode of 21 March 1963, "Ed the Zebra," and the episode of 17 October 1965, "Anybody Got a Zebra?" The former episode was a joke-within-a-joke wherein a disgruntled Ed ran away to the zoo, leaned up against a newly-painted black fence, and started a new life as a zebra. (Ironically, the photography crew actually had to shoot Ed's "zebra" scenes for that episode in color and then convert them back to black-and-white in order to make Mister Ed appear as a zebra to the audience!)
When CBS switched to a primarily color prime time line-up for the 1965-66 season, both they and the series' producers were faced with a dilemma: keeping the show as a black and white entry would have presented a jarring contrast with the network's other shows, but switching to color would have given away the ruse. Eventually, a CBS executive came up with a clever solution: the show was moved out of prime time into the 5:30-6:00 PM slot on Sunday evenings for the series' final year, thus avoiding the necessity of its conversion to color.