I'm thinking it began, way back whenever, as a transparent way to take advantage of this new Christian holiday to legitimize a period of dark-season feasting -- visiting, socializing, goofing off -- that pagan societies had long built into their solar-based calendar. In the northern lands, at least, the balance point of the whole year is the Winter Solstice, or 'shortest day of the year.' Once they had established a calendar, people were happy to see the winter solstice arrive because it meant that the days would begin to get a little longer. When the sun rises sufficiently high and the periods of sunlight grow long enough to warm the earth, the green world begins to grow again, it's possible to start planting, and it appears humanity won't starve quite as quickly as our earlier ancestors must have feared when the days kept getting shorter.
Or maybe they were only pretending to be afraid. In any event, it was clearly time for a party. The ancient Roman Saturnalia took place around this time, a period of feast days ostensibly honoring Saturn, the god of the underworld who has for a time succeeded in capturing the sun. Or, in one telling of the myth, in capturing Persephone, Mother Earth's daughter. When Persephone is forced to go underground for a certain period year to live with Saturn -- as a result of negotiations with the girl's mother -- Earth shuts down in sorrow. (Some see this as a feminist interpretation of marriage; but I digress.)
That cold period is just beginning -- three months of winter -- so human beings might also see this "solstice festival" period as a good time to relax and party a while before the cold truly sets in and there's nothing to do but try to stay warm and wait out the period of little or no fresh food, decreasing stores, and not much to do.
The Christian church came along and settled on twelve days for this festival, the period that stretches from the birth of Jesus to the Feast of Epiphany. The word Epiphany means 'revelation' as in the revelation of the newborn savior to the three wisemen, magi, or kings who have traveled afar to find him. Also called 'Three Kings,' or 'Little Christmas,' Epiphany is an important holiday. For one thing, the three kings brought gifts. Which is why we are still giving and receiving gifts this time of year two thousand years later.
The holiday of Epiphany, falling on either Jan. 5 or Jan. 6 (depending on how your tradition begins counting the days), is particularly important to the Orthodox Christian church, the Greek-speaking church spread through eastern Europe and western Asia from the time of the Byzantine Empire -- in fact more important than Jesus's birthday. For many followers of that church, you get your gifts on Jan. 5. By that accounting you're still not late with a present if you get it there by Tuesday.
In some cultures, the gift-giving is spread out through this period, one gift per day.
And somewhere along the line, tradition gave us a song about those twelve days as well. In my family's annual celebration (on good old Dec. 25), singing the song itself has become a tradition.
Interestingly, various attempts at explanation have grown up to account for the weird assortment of 'presents' the 'true love' of the song bestows on us, something different for each of the twelve days. Weirdest, or perhaps most intriguing, of these is the idea that different gifts are mnemonic devices for catechism, that is, the recall of important doctrinal messages. One further speculation: the song was a device by persecuted Catholics in Tudor England to teach theology.
To begin, we have to understand that our 'true love' is -- drum roll -- God. And on the first day, the nativity, he bestows on us -- a partridge? Well that turns out to be a symbol for Christ. (I read the explanation; already forgotten.)
The two 'turtle doves' are the two testaments of the Bible. The French hens are the 'three theological virtues," faith, hope and love." I don't know how these virtues became 'French hens,' but the 'French' part is said by some commentators to indicate the foreign origin of the song itself.
The four 'calling birds' are of course the four gospels. And, interestingly, those five gold coins -- monotheism's gold standard -- are the five books of the Torah, the first five books of the Bible.
The six geese a-laying are the six days of creation (use your imagination). The seven swans are the seven gifts of the Holy Spirit enumerated in the New Testament. The eight maids a-milking (expect no further attempts at elucidation of the symbols) are the eight beatitudes, Jesus's sermon that begins "Blessed are the poor in spirit."
The nine dancing ladies are 'the fruits of the Holy Spirit' (the list begins with 'love,' again from a New Testament source). The 10 lords a-leaping are -- you guessed it -- the famous commandments. The 11 pipers are the faithful apostles (11 is a hard number to explain). And 12 drummers supposedly refer -- this depends I think on some close textual analysis -- to the 12 doctrines avowed to in the creed.
Or maybe not. In the absence of compelling evidence one way or another, most sources see the song's origin as probably secular and folkish. Just a song people liked to sing back then, just as they still do now.
Maybe we should sing it again on the 12th Day of Christmas.