The purpose of a pirate ship’s flag was to signal a merchant vessel that if it didn’t surrender, it would be boarded and plundered by force.
Pirates used a variety of flags.
One was an hourglass that signaled time was running out.
The skull and crossbones is of course the most famous flag, and it got its name “Jolly Roger” from the English pronunciation of “Ali Rajah,” which is Arabic for “king of the sea.”