While a decade long international effort to suppress Somali piracy has succeeded, there has been a huge increase in piracy elsewhere. In the Straits of Malacca there has been a sevenfold increase since 2009 and off Nigeria there has been a similar increase. The big difference is that only off Somalia could ships and crews be taken and held for ransom for long periods. Everywhere else the pirates were usually only interested in robbing the crew and stealing anything portable that they could get into their small boats. But a different type of piracy has developed off the Nigerian coast where pirates increasingly kidnap some ship officers to hold for ransom. Other Nigerian pirates have taken to forcing the crew to move small tankers to remote locations where most of the cargo (of oil) can be transferred to another ship and sold on the black market. The seized ship and the crew are then abandoned as the pirates make off with much of the cargo and anything else they can carry off the plundered ship.
The Nigerian pirates have no safe havens like the Somali pirates did but make up with it in other ways. The Nigerian pirates are actually more violent than their Somali counterparts and will often overcome an armed guard on the ship. In part that’s because the armed guards are often local hires and not as skilled and steadfast as the armed guards hired for ships moving past Somalia. Moreover, the ship guards have to depend on the Nigerian security forces for backup and the Nigerian Navy is not as responsive or effective as the international anti-piracy force off Somalia. These differences are leading more land-based Nigerian criminal gangs to try piracy and the international shipping companies are finding themselves more vulnerable than they were off Somalia.
Pirates usually function on the margins of society, trying to get a cut of the good life in situations where there aren't many options. This is usually in areas where state control is weakest or absent, in failing and "flailed" states. A flailing state is something like Nigeria, Indonesia, or the Philippines, where the government is managing to keep things together but is faced with serious problems with areas that are sometimes out of control. In a failed state like Somalia where there isn't a government at all, pirates can do whatever they want.
The solution to piracy is essentially on land; go into uncontrolled areas and institute governance. This has been the best approach since the Romans eliminated piracy in the Mediterranean over 2,000 years ago. Trying to tackle piracy on the maritime end can reduce the incidence of piracy, but can't eliminate it completely because the pirates still have a safe base on land. In the modern world the "land" solution often can't be implemented. Who wants to put enough troops into Somalia to eliminate piracy? And flailing states are likely to be very sensitive about their sovereignty if you offer to help them control marginal areas.
The two areas where pirates now thrive do so because of weak local law enforcement and the lack (so far) of an international military response. Thus piracy in the vital (most of the world's oil exports pass through here) Straits of Malacca was largely an Indonesian phenomenon. It bothered the Singaporeans a lot, the Malaysians a little, and the Indonesians not much. But as Indonesia began stabilizing itself over the past decade (the 2004 Aceh Peace settlement, the institution of a more democratic government, defeating Islamic terrorism and so on), the rate of piracy declined. This decline was facilitated by the combined police effort of Singapore, Malaysia, and Indonesia itself, which didn't come about until a lot of issues among the three states were resolved. Neither Indonesia nor Malaysia were all that upset about smuggling, which bothered Singapore. Indonesia and Singapore still have some problems, as Singapore more or less encourages enormous volumes sand stealing off isolated stretches of Indonesia’s coastline. Since 2010 there has been an increase in piracy off Indonesia, largely because the Indonesians reduced their anti-piracy patrols without warning or explanation. There are lots of targets, with over 50,000 large ships moving through the Straits of Malacca each year. That’s 120-150 a day. Lots of targets. The shallow and tricky waters in the strait forces the big ships to go slow enough (under 30 kilometers an hour) for speed boats to catch them.
In contrast to the Strait of Malacca situation, the U.S. approach to piracy has been largely a police mission, without trying to deal with the land-side. Again, that would mean occupying Somalia. But there are some regional constraints on piracy. There seems to be little or no piracy in the Red Sea and Bab al-Mandeb. Apparently this was because the smugglers decided the pirates interfered with their business (by bringing in coalition naval forces), and so shut down any pirate operations themselves.
It should be no surprise that the Gulf of Guinea has become another hot spot for modern (non shipnapping) piracy. Nigeria is badly run and most of the oil revenue is stolen by corrupt officials, leaving people living in the oil producing areas near the coast very angry. More piracy has been one result of all that anger.