The second half of "eggnog" was originally a beer. Long before anyone whisked milk and rum together for Christmas, nog was the name of a strong ale.
Etymonline finds nog in the 1670s, first in the phrase "boull of nogg," a bowl passed around among company. A poem from the same decade mentions "sweet nog." By the 1690s the word names an old, strong type of beer brewed in Norfolk, in eastern England. Drinkers who had too much were "noggy," meaning tipsy.
Nobody knows where nog came from. Etymonline says it may be related to noggin, which appears in the 1620s as a small cup or mug. Since the origin of noggin is unknown too, the link explains neither word.
The compound is American. The earliest known use of "eggnog" is in a 1775 poem by the Maryland clergyman Jonathan Boucher, though the poem was not published until long after his death. The first use in print came in the New-Jersey Journal of March 26, 1788. Isaac Weld Jr., in an 1800 book on his American travels, defined it as "a mixture composed of new milk, eggs, rum, and sugar, beat up together."
A popular alternative explanation says colonial slang called rum "grog," so the drink was first "egg-n-grog" and later "eggnog." Frederick Douglass Opie, a Babson College professor, has put this forward. Ben Zimmer of Vocabulary.com says the theory lacks proof. He suggests nog might instead come from Scottish nugg, or "nugged ale," ale warmed with a hot poker. The older Norfolk ale fits the word without any slurring at all.
The drink is older than its name. It may have developed from posset, a medieval European drink of hot milk curdled with wine or ale and flavored with spices. Some possets included eggs, and they were taken as a remedy for colds. Britain had its own relative, the egg flip, named for flipping the mixture between two pitchers.
Early American eggnog was a rum drink, and George Washington reportedly served a version made with rye whiskey, rum and sherry. It was also strong enough to cause trouble. At West Point in December 1826, cadets smuggled whiskey in for a Christmas eggnog party. The result was the Eggnog Riot, and twenty cadets and one soldier were court-martialed.