In ancient times, there was a man who raised monkeys, which became more and more mischievous as they grew up and often destroyed his things. One day the man caught a cock. He assembled the monkeys and said to them:” If you don’t behave and stop causing trouble, you will end up like the coke.” Then he killed the coke in front of the monkeys. Seeing this, the monkeys were frightened and became obedient thereafter.This idiom is used metaphorically to mean to frighten somebody by punishing someone else.