The story is taken from The Records of the Warring States.
In the Warring States Period the states of Han and Wei were at war and locked in a stalemate for a long time. The King of Qin was considering whether to become involved. One of his advisers told him the story of how Bian Zhuangzi killed tigers. He said, “Once, Bian Zhuangzi saw two tigers fall upon an ox. He was just about to go and try to kill them when his friend stopped him, explaining that the tigers would fight over the ox; the smaller one would end up being killed, while the other would be badly wounded. If Bian Zhuangzi were to wait until then, he would take both tigers easily. Bian Zhuangzi did as he suggested. Just as expected, the smaller tiger was killed by the bigger one, which, being wounded, was killed easily by Bian Zhuangzi. So the two tigers were taken in one move. Now Han and Wei are at war. The result will be that one will be subjugated and the other weakened. If you attack then, you will gain both with one blow.” The King of Qin accepted this suggestion and gained an easy victory.
Later, the expression “sitting on a hill watching tigers fight” came to be used to mean watching in safely while others fight, then reaping the spoils when both sides suffer.
Source: The Stories Behind 100 Chinese Idioms by He Zeren & Zhou Lingzhong