No doubt it has origins in the Middle Ages, when the range of confections was small, and peasants would labor an entire year in the fields without ever getting something sweet. Their reward for their partipation in the feudal system would be a scrap of Fruitcake thrown from a carriage as the Lord drove past on Christmas morning. Those that did not touch their caps were beaten by overseers. And that's where we get our tradition today! You know, beating someone who gives you fruitcake. Some of the details were changed over time.