War elephants in North Africa
In his description of the battle of Raphia (217 B.C.), the Greek historian Polybius claims that the Indian elephants of the Seleucid army were more effective than the elephants in the Ptolemaic army, because the latter pachyderms were smaller (Polybius 5.84.4). This explanation is rather odd because the African bush elephant (Loxodonta africana) is larger than his Asian counterpart (Elephas maximus indicus).
Historians have resolved this issue by assuming that the Ptolemaic armies used African forest elephants (Loxodonta cyclotis), which are indeed smaller. The forest elephant must, somehow, have been accessible. A second assumption was that this animal, which nowadays mainly lives in the tropical rainforest of Cameroon, was also found in Eritrea and Sudan. This assumption can now be tested by examining DNA.
If forest elephants once lived in Eritrea, we would expect that the DNA of the bush elephants living there today contains traces of forest elephant DNA. This phenomenon, admixture, is familiar from Homo sapiens, which contains some Neanderthal DNA. Since these predicted traces are missing, the inescapable conclusion is that the forest elephant never lived in Eritrea. The Ptolemaic kings, therefore, must have deployed bush elephants.
Bush elephants are, however, larger than their Indian counterparts, which means Polybius was mistaken. The most plausible explanation is that he was led astray by the common Greek prejudice that everything in India was bigger, which is well-documented (e.g., Herodotus, Strabo).
What about Carthage?
There was another place where elephants grazed: the Maghreb. This must have been an important place for the Carthaginians to obtain their elephants. There is some frantic speculation on Wikipedia that an extinct subspecies of forest elephant (Loxodonta africana pharaohensis) known from the Prehistoric Fayyum may have survived in the Maghreb, but this gets little support from biologists. The vegetation of the Atlas Mountains, with its open forests, is unsuitable for the forest elephant. It resembles the tropical rainforest less than the savannah. This suggests that bush elephants lived here.
That the Carthaginians knew this animal is also shown by Punic coins, minted on Sicily and in Iberia, on which elephants are always depicted with tusks pointed forward and somewhat angular ears - very different from the forest elephant, whose tusks are pointed to the ground and which has round ears.
Does all this matter much? Well, yes, actually. Unlike the smaller forest elephants, bush elephants could be equipped with wooden towers from which warriors could stab down with spears. It implies entirely different battle tactics.
Michael B. Charles, "The African Elephants of Antiquity Revisited: Habitat and Representational Evidence," in Historia 69/4 (2020) 392-407 (paywall).