Contrary to what you may have been taught to believe by some cartoons and amusement park rides, pirates were not always a pleasant lot. Pirates were actually a real threat to the people availing sea routes.
Disney films are often based on old folktales, but not all of them have been modified from sources like the Brothers Grimm; some of them are actually based on actual historical persons and events.