Pirates need bases. If the pirates are strong enough and can manage to ally instead of preying on each other, they could hold or even build a city of their own. A strong navy would still root them out... if a strong navy can be raised by their victims and they can find the pirate city. Maybe some of those unusual parts of the city are a base for an outlawed group of magicians who obscure the city's location with their powerful magic in exchange for shelter and supplies from the pirates.