The second Punic War happened because Rome did not like how Carthage was expanding into Spain and Carthage wanted to make up for the losses they had from the first Punic War.
During the second Punic War, Hannibal sailed an army to Spain and then crossed the Alps. Almost half of his army died but they were still powerful. Hannibal defeated the Romans at Cannae and raided Italy. Roman forces led by Scipio captured Spain and attacked Carthage. Hannibal returned home to defend and were defeated by Scipio's troops.
After the second Punic War, Carthage had to give up their navy and pay a lot of money to Rome. Carthage also had to give Rome the Spanish territory they had and now Rome was known as the supreme power in the western Mediterranean.