The Jolly Roger was only one of many pirate-flag insignia. Why fly a pirate flag, anyway? To terrorize victims into surrendering without a struggle.
The earliest such flags were plain red or black sheets; red symbolizing blood and battle, black for death. Later captains added emblems: hearts dripping blood, fiery balls, hourglasses, cutlasses, skeletons, etc. Around 1718, Captain Richard Worley flew a black flag with a white death's-head and crossed femurs, a symbol of death dating to medieval times.
By about 1730 this design had caught on among English, French, and Spanish pirates in the West Indies and was called the "Jolly Roger" or "Old Roger."