Animals are often difficult to teach to do specific stunts or to stay still. The easiest way to teach any animal to do something is to give some sort of reward when the task is accomplished, and to give a punishment when the task is failed. So, when and elephant, tiger, or any other animal does not do exactly what a human performer would want to be done, the animal is whipped.
Such violent methods are not necessary. We don't whip dosgs when they bark, do we? We don't poke them with shark hooks when they fail to correctly give us a high-five or sit down. That is proof that circus animals do not need to be treated the way they so often are.