Sophonisba was the daughter of a Carthaginian nobleman named Hasdrubal, who is usually called "the son of Gesco" to distinguish him from his namesake and contemporary, Hasdrubal the brother of Hannibal. As was normal in those days, Hasdrubal used his daughter to conclude diplomatic alliances. Until 206, she was betrothed to Massinissa, the leader of the Massylian (or eastern) Numidians.
However, in 206, things changed. Massinissa had witnessed how the Romans, who were at war with the Carthaginians, had driven the Carthaginians out of Iberia, and had started to doubt about his alliance. His doubt became a certainty when his father Gala died and king Syphax of the Masaeisylian (western) Numidians was able to conquer eastern Numidia. Massinissa, who had lost almost everything, now allied himself to Rome, which could not prevent that he was eventually defeated by Syphax.
Having lost the alliance with Massinissa, Hasdrubal started to look for another ally, which he found in Syphax, who married Sophonisba. The alliance was solid: when the Romans invaded Africa, Syphax and Hasdrubal cooperated. They were able to force the Roman general Publius Cornelius Scipio to abandon the siege of Utica.
Yet, Scipio was not defeated, and with the help of Massinissa, he overcame his opponents. In the battle of the Great Plains (203), he overcame Hasdrubal and Scyphax, and launched an all-out attach on Carthage. Meanwhile, his deputy Laelius and Massinissa pursued Scyphax to Cirta, where the Masaeisylian king and Sophonisba were captured.
What happened next has become the stuff of romance, but the facts are prosaic. Massinissa decided to marry Sophonisba, with whom he had once been betrothed. As a king, he needed to compensate for the humiliation of the broken engagement. Besides, Sophonisba could support his claim to the throne of western Numidia. However Scipio suspected Sophonisba of being an ardent patriot, and criticized Massinissa's marriage. The Numidian leader therefore poisoned his new queen.
This was the unromantic end of a lady who had always been a pawn in power games beyond her control. There must have been hundreds of women in Antiquity with similar careers, but Sophonisba is one of the few who has retained a name.