Every account I’ve read between Hamilcar, Hannibal, and Hasdrubal utilizing elephants in battle has either resulted in the elephants 1) being irrelevant or 2) backfiring as they got scared and ran backwards into Carthaginian forces.
I assume your question mainly refers to the Barcid incursions, but there was most certainly others such as the battle of Bagradas, led by a Spartan mercenary hired by the Carthaginians. If, however, I am correct in the assumption that this question mainly refers to Barcid incursions, I will touch mainly on the Battle of the Trebia, and Hamilcar’s efforts against rebels in around 240 BCE. (I assume in this post that you know what war elephants were mainly meant to do, if this assumption is wrong please reply and I will gladly explain to you.)
(I like Hannibal much more, so I will put him first!) Livy puts it decently well here, but I will provide further analysis after:
“The elephants, towering aloft at the ends of the [Roman] line, terrified the horses not only by their appearance but by their unaccustomed smell, and created widespread panic. The infantry battle, as far as the Romans were concerned, was maintained more by courage than by physical strength, for the Carthaginians, who had shortly before been getting themselves into trim, brought their powers fresh and unimpaired into action, whilst the Romans were fatigued and hungry and stiff with cold. Still, their courage would have kept them up had it been only infantry that they were fighting against. But the light infantry, after repulsing the cavalry, were hurling their missiles on the flanks of the legions; the elephants had now come up against the centre of the Roman line, and Mago and his Numidians, as soon as it had passed their ambuscade, rose up in the rear and created a terrible disorder and panic.”
Essentially, the Carthaginian war elephants were used as a disorienting tactic, wherein a charge occurs and ranks likely would break. Moreover, as Livy said, the Roman cavalry was generally shaken by the very presence of elephants. However, horses are spooked by the absolute weirdest things. For instance: there have been ancient accounts of horses not being spooked by rats, but merely flatulence, so perhaps that could be an explanation. However, the majority of the work that the Carthaginian elephants did was what followed this, and only as a result were the elephants able to do so. The Carthaginian elephants moved the cavalry on the wings, forcing Roman troops to deploy solely against the elephants in what has described to be a ‘hollow box.’ Not only did they do that, though, but more importantly, the cavalry was no longer protecting the flanks of the infantry. Which, as stated above, led to the ultimate goal of Numidian cavalry attacking Roman forces in the rear, and elephants ransacking throughout the mid-Roman line.
Ultimately, I would say that this helped them win the battle.
Next, I will touch on Hamilcar’s military action against mercenaries (namely those led by Spendius, Mathos, Autaritus, Naravas, and Zarzas.),(pay your mercenaries kids!) and where elephants were used substantially to Carthaginian benefit.
Let’s first start with the mercenary wars and why they started: essentially, Carthage hadn’t paid their mercenaries, and, thus, they revolted under the aforementioned leaders. However, later into the war, Numidian nobles start to defect, and now providing aid to Hamilcar’s side, rather than the rebels. Polybius states here what eventually happens in the battle, which is unfortunately all we really have.
”There was a certain Naravas, a Numidian of high rank and full of martial spirit. He had always had that attachment to the Carthaginians which was traditional in his family, and it was now strengthened by his admiration for Hamilcar. Thinking that this was a favourable opportunity for meeting Hamilcar and introducing himself, he rode up to the camp escorted by about a hundred Numidians. Coming close to the palisade he remained there quite fearlessly making signals with his hand. Hamilcar wondered what his object could be and sent out a horseman to meet him, when he said that he desired an interview with the general. The Carthaginian leader remaining still much amazed and distrustful, Naravas handed over his horse and spears to his attendants, and very boldly came into the camp unarmed. The Carthaginians looked on in mixed admiration and amazement at his daring, but they met and received him, and when he was admitted to the interview, he said that he wished all the Carthaginians well but particularly desired the friendship of Barcas, and this was why he had come to introduce himself and offer his cordial assistance in all actions and enterprises. Hamilcar, on hearing this, was so delighted at the young man's courage in coming to him and his simple frankness at their interview that not only did he consent to associate him in his undertakings but swore to give him his daughter in marriage if he remained loyal to Carthage.
The agreement having thus been made, Naravas came in with the Numidians under his command, about two thousand in number, and Hamilcar, thus reinforced, offered battle owing to the enemy. Spendius, after effecting a junction with the Libyans, descended into the plain and attacked the Carthaginians. The battle was a stubborn one, but ended in the victory of Hamilcar, the elephants fighting well and Naravas rendering brilliant services.”
As previously stated, all we have tactic wise is that the ‘elephants fought well.’ I hate it too, but it’s at least an example of your question. From what modern scholars can infer from writings, it’s likely they were used as harassing units to trick the enemy into fully committing troops into a bad engagement, rather than the inherent commitment is to engage in battle; like what is seen in the Trebia, as well as the later parts of Alexander’s campaigns in India.
If you would like me to do a write up of the Battle of Badradas, and how elephants were used to Carthaginian benefit, feel free. I felt like it wasn’t your question, so I abstained upon it, but I am very happy to do it for you if I am mistaken here.
Sources
Reginald Bosworth Smith, Rome and Carthage: The Punic Wars
Adrian Goldsworthy, The Punic Wars
Nigel Bagnall, the Punic Wars
Livy, book XXI
Polybius, Histories 1
Polybius, Histories 3
While this isn't directly answering question, a big part of the reason Carthaginian war elephants were ineffective against the Romans is because they had already encountered them numerous times against King Pyrrhus Of Ephirus, but more specifically they had already devised tactics against them during the Sicilian campaign of 278 BC. (during the pyrrhus war oc)