Hannibal was a was a young man when he went to fight in Iberia (Haspaina, modern day Spain and Portugal). There, with his father, he vowed never to befriend Rome. This was after the first Punic War had ended. A while later, his father was killed in battle, and his brother was assassinated. Leaving Hannibal in charge of a group of Carthaginian forces. He was a good general, and was soon sent on a mission to pillage Rome. He took a massive army, including 37 elephants, and took this route to Italy:

While Hannibal was pillaging in Italy, other forces were fighting in Hispaina and Sicily (the island just southwest of the tip of the Italian Peninsula, not labeled on this map). This kept Rome distracted. Hannibal could pillage the countryside of Italy, but could not conquer any large cities. Rome, on the other hand, could defend its cities, but not beat Hannibal in the field. So it was pretty much a 17 year stalemate. Rome finally decided to sail south and attack Carthage itself, and Hannibal finally had to retreat to protect the city. This was basically the whole of the Second Punic War.