There are several reasons.
Experts are beginning to notice that elephants exhibit characteristics similar to PTSD. This stems from witnessing, as young elephants, humans killing members of their herd solely to remove their tusks and leave behind carcasses. As a result, they have become more aggressive towards humans out of fear. They associate humans with murder and essentially hate them. Understandably so.
If the matriarch has had a bad experience with people, her behavior will adjust accordingly, becoming more fearful or aggressive depending on her own personality.
Other members of the family follow her lead in moments of crisis, and the young elephant learns how to behave. Aggressive behavior towards humans can be learned. Just as children learn prejudices from their parents, so too can elephants.
next, This is when the male becomes the mast. They are extremely dangerous. They are filled with very high levels of testosterone and itching to fight. They will attack anything that moves. This is easily identifiable as there is often a leak from the temples and wet feet. Mast elephants often excrete a thick, tar-like secretion called temporin from the temporal canal on the side of their head and urinate with their legs.
Because humans have killed many older male elephants for their tusks, younger male elephants are entering the mast earlier than before. This led to a tragic incident in the 1990s in two South African national parks where mob elephants killed more than 100 rhinos without provocation. It only stopped when older, larger male elephants were brought there.
Herds of female elephants with young calves can also be dangerous, especially if you startle them in some way while walking. It's not uncommon for elephants to charge at people on foot or in vehicles, but you can usually tell they're serious from the quietness of the charge and the position of their ears. The most dangerous are when they charge silently with their ears held back.
Elephants in Cameroon are currently facing a crisis. Just this month, horseback poachers killed half of the elephant population in search of ivory. This poaching slaughter is being called one of the worst in decades, with at least 200 elephants killed for their tusks by horseback poachers from Chad and Sudan since January. More than 400 people have died since the hunting season began.