Why are there pirates in Somalia?

Pirates have historically thrived in envirnments with little or no law. Somalia at this point has virtually no legal system to speak of, so it is easy for them to hide, and continue using Somalia as a base.