The earliest of pirates’ flags was, when displayed, no more, likely, than a plain black sheet.
Later some of the pirates began to embellish them with designs in white of grinning skull and crossbones, and by the mid-nineteenth century such was the general ensign.
To the English, about the middle of the eighteenth century, the black flag of pirates became known as a Roger or, eventually, a Jolly Roger.
No writer of the period gives a reason for such designation, so a guess may be in order.
Roger, perhaps then pronounced with a hard g, among members of the underworld, the “canting crew,” as they were called, had long been a term applied to a beggar or “rogue.”
Jolly, of course, meant “carefree.”
It would follow, therefore, that the Jolly Roger would represent the flag of carefree rogues.
Please, however, this surmise has nothing to do with the reply “Roger!” used in radio communication to signify “Right! Received!”
That is an arbitrary term for the letter r, derived from military signaling.