The original 1960s attraction inspired the movie that became Pirates of the Caribbean: The Curse of the Black Pearl, and then the characters from the movie became part of the ride itself.
The relationship between Pirates of the Caribbean, the Disneyland attraction, and Pirates of the Caribbean, the film franchise, is one of perpetual influence of one upon the other.
However, it turns out that Curse of the Black Pearl is an even bigger part of the attraction at Disneyland than you might think, because an actual prop from the movie can be found inside the ride.