"O Come All Ye Faithful" (Adeste Fideles) is thought to be a Portuguese hymn for Christmas Day (the earliest manuscript bears the name King John IV and is held in the Ducal Palace of Vila Viçosa). The English lyrics are attributed to John Francis Wade (1711 - 1786).
The authorship of both the music and the lyrics are open to question. The English lyrics have been changed several times and the Wiki entry goes into some detail but I selected the above interpretation because it suggests that Wade's lyrics were actually subversive.
The words of the hymn have been interpreted as a Jacobite birth ode to Bonnie Prince Charlie. Professor Bennett Zon, head of music at Durham University, has interpreted it this way, claiming that the secret political code was decipherable by the "faithful" (the Jacobites), with "Bethlehem" a common Jacobite cipher for England and Regem Angelorum a pun on Angelorum (Angels) and Anglorum (English).
Wade had fled to France after the Jacobite rising of 1745 was crushed. From the 1740s to 1770s the earliest forms of the carol commonly appeared in English Roman Catholic liturgical books close to prayers for the exiled Old Pretender. In the books by Wade it was often decorated with Jacobite floral imagery, as were other liturgical texts with coded Jacobite meanings.
After the 1715 and 1745 Jacobite rebellions, support for their cause gradually faded and was largely forgotten, to be replaced by an acceptance of Unionism (the Union of the Crowns).
P.S. JD adds: I am not a Jacobite by the way and I don't know of anyone who is. Occasionally the 1745 becomes the quarter to six rebellion in barroom conversations and nobody is offended :)