The music of the Christmas Oratorio was not originally written for the Church.
3rd August,1733 was the name-day of Friedrich August II, the new Elector of Saxony. Bach, in his position as Director of the Leipzig Collegium Musicum, began a series of celebratory secular cantatas. The first of these is lost, but cantata no. 213, written for the Elector's heir, does remain, along with 214 (for the Electress) and 215 (for the Elector's coronation as King of Poland on 19th February 1734). The music is festive and virtuosic; most was performed al fresco to complement the fireworks!
The Christmas Oratorio is a parody work based on these secular cantatas. It consists of six cantatas, the first of which was performed on Christmas Day 1734, and the last at Epiphany 1735.