One reason could be to create a sense of shock or surprise. It makes the story more unpredictable. For example, in 'Game of Thrones', the sudden death of Ned Stark shocked readers and viewers alike, completely changing the direction of the story.
Sometimes it's to develop other characters. When a character is killed off, it can force the remaining characters to grow, adapt, or face their fears. In a detective novel, the death of a partner might make the detective more determined to solve the case and also show their vulnerability.
One effect is that it can create a huge shock for the readers. It completely changes the expected narrative direction. For example, in 'Game of Thrones', the death of Ned Stark was a turning point that made the story more unpredictable and full of high - stakes drama.
One reason could be to create a sense of extreme tragedy or futility. By eliminating all the characters, the author might be trying to show that in the world of the novel, there is no hope and all are doomed. It could also be a very extreme form of making a statement about the futility of life or the overwhelming power of certain forces, like a cruel and inescapable fate or a devastating event such as a global catastrophe that no one can survive.
To set a dark or tragic tone. If an author wants to show that the world of the novel is a harsh place from the start, killing off a character early can be an effective way. For instance, in '1984', the way the Party eliminates people early on gives a sense of the totalitarian and dangerous world.
It can make readers sad. If they've become attached to a character, that character's death can be quite emotional. Like when we read about the death of Dobby in the Harry Potter series.
Sometimes, it's a way to show the harsh reality of the story's setting. If it's a war - themed novel, killing many characters can depict the horror and destruction of war. Like in 'All Quiet on the Western Front', the large number of deaths among soldiers effectively conveyed the brutality of World War I.
One effect could be shock value. It can jolt the readers and make them more engaged as they try to figure out how the story will progress without that character. For example, in 'Game of Thrones', Ned Stark's early death completely changed the direction of the story and made readers more eager to see how the power struggle would unfold without his influence.
Perhaps the elephant was in pain or sick. When animals are not well, they can act unpredictably. So, if the elephant had an injury or an internal illness, it might have lashed out at the woman without really intending to kill her. Another reason could be that the elephant was protecting its food source or its young. Elephants are very protective of their calves and their feeding areas. If the woman was perceived as a threat to either of these, the elephant could have attacked.
One reason could be the tiger's territoriality. If the lady entered the tiger's territory, it might attack to defend it.
Maybe some writers want to explore extreme character deviations. They might be interested in creating a shock factor by making a beloved character like Ahsoka do something so heinous. It could also be an attempt to explore a very dark, alternate universe where all the good characters turn bad.
It could be due to a great tragedy. For example, if all his friends were killed and he was filled with rage and revenge. In that state of mind, he might become a killing machine, just focused on destroying those who wronged him.