The idiom originated from the Qin Dynasty (秦朝) (221 - 206 B.C.) following the death of Qin Shi Huang (秦始皇), the first emperor of the dynasty and first emperor of a unified China after the state of Qin conquered all of the other states of that period.
During the reign of Qin Er Shi (秦二世), literally the "Second Emperor of the Qin Dynasty" in 210 - 207 B.C., the prime minister, Zhao Gao (赵高), was a man with greedy ambitions bent on usurping power.
He wished to rebel and take the throne but feared that some of the officials might be against him.
When the ministers were asked, half of them told the truth and said that it was a deer, while the other half, either fearing Zhao Gao or supporting him, said it was a horse.
Facing this situation, the emperor actually doubted himself and chose not to believe his own eyes but to believe the words of the treacherous minister.
Later generations used the idiom "Pointing To A Deer and Calling It A Horse (指鹿为马)" to describe a situation in which someone reverses black and white and turns the truth upside down in order to deceive others. It also represents a situation where a person is so powerful that he can do anything, even insisting that a deer is a horse.