The following is an answer that I gave to a similar question a few days ago:
Various Christmastime entities had a reputation for giving coal to naughty children; indeed, giving coal to misbehaving redditors appears to be ancient. Well that last part may be an exaggeration, but children were warned about their behavior lest coal was their reward.
These traditions were referred to as "ficts" by the highly regarded folklore theoretician, Carl Wilhelm von Sydow (1878-1952): a fict was something told to children to be believed, but that the adults did not believe (as opposed to a legend that was told to be believed generally by everyone).
Various ficts were linked to Yuletide coal. The US probably can thank the Dutch for the tradition. Many European cultures had traditions of a gift giving winter entity who was followed by an antithesis who meted out punishment or dispensed coal, etc. The traditions - as expressed as ficts - happily turned the somber, darkest winter days into something to be anticipated with joy. The aspect of punishment was the pre-modern equivalent of that little modern snitch, the elf on the shelf. These served to inhibit gleeful expressions of childhood from being expressed in negative ways.