In the olden days, people used to believe in all sorts of superstitions. Up here in the north, where seasons are very different from eachother, the solstices used to be very important. Before the Gregorian calender the winter solstice used to fall on the 13th of December.
It was a magical night, where evil spirits, trolls, goblins and all sorts were on the prowl, and you should stay indoors and keep yourself safe. It was also the beginning of the old Viking yule tide, when the pigs for the feast were slaughtered. (And all sorts of offerings were given. In the old Viking "temple" outside Uppsala they think slaves were offered to the Viking gods too!)
In the Middle Ages, Christianity was introduced to the old Viking countries, and winter solstice lost it's religious importance, but remained special for most people. You were still supposed to slaughter your pig on the 13th, for the best meat for the Christmas feast, and in those days, when Sweden was a Catholic country, the Christmas fast began on the 13th.
When the Gregorian calender was introduced and the 13th no longer was winter solstice, it was still considered the longest night of the year, and the tradition was to stay up all night. Young people sometimes took to walking around the villages, singing and playing tricks on people, often expecting some money, some food before the fast started or a drink of alcohol.
In the late 16th century people started to connect the tradition to the Catholic Saint Lucia, and a girl, clad in white with candles in her hair began to feature in the celebrations. Soon she was followed by a whole choir! And in the late 1800s the celebration spread to other parts of the Nordic countries. Nowadays, the tradition is secular but in the shape of Catholic tradition, and every school and town have their own St Lucia, often crowned by prominent people in the town's market square. In most families, the children get up early in the morning to sing to their parents and serve them breakfast in bed.