One of the strangest innovations in warfare began around 4000 BC with the training of elephants in the Indus River Valley. Elephants were both an advantage and disadvantage for the armies that employed them up until the widespread use of gunpowder in the 16th Century. Sultans of India used them to fight Mongols. Alexander the Great, Carthaginians, Romans and several African civilizations all used war elephants at one time or another.
The potential advantages of war elephants are immediately obvious when considered from the point of the army facing them. Imagine a hundred or more elephants each weighing as much as five tons stampeding toward you. The shock effect alone would be staggering on both soldiers and their animals. Apparently, horses unaccustomed to elephants are frightened by the mere smell of the animals. Elephants were extremely difficult to kill and once charging they were difficult to stop. Armies using Asian elephants placed fighting towers on their backs. Usually the towers held an officer, archer and an infantryman with a lance. Outfitted with such a shielding tower, the elephants were used in much the same manner as latter day tanks. Traveling armies took advantage of the elephant''s enormous strength by carrying heavy loads of equipment and supplies.
But elephants did not insure invincibility and were often a disadvantage. Only the larger Asian elephants or African plains elephants were able to maintain towers on their backs. The smaller African forest elephants (now extinct) usually only carried a single rider. Iron spikes in heavy wooden frames or wound through chains could be used against the elephants. Severely wounded or otherwise repulsed elephants tended to run amok. Similarly the loss of the elephant's driver would cause the elephants to charge about indiscriminately.
The most famous use of war elephants would have to be that of Hannibal and his armies crossing the Alps to attack the Romans. In reality, most of Hannibal's elephants died in that crossing or shortly thereafter. He did manage to replace many of them but they only played a pivotal role in one battle -- Trebia River. By the time Hannibal met the Romans at the last battle of Zama they had learned to create formations to "herd" the elephants through their ranks. The elephants that didn't pass through were as much a danger to their own army as to the enemy.