And the answer: 13.
In Medieval England, bakers included extra goods in their deliveries to avoid jail time for short-changing customers. A baker's dozen can sometimes include 14 items, although it most commonly contains 13.
Throughout history, many societies have practiced extremely strict laws concerning bakers' wares. However unlikely it may seem to us now, the relative ease by which patrons could be cheated was reason enough to regulate bakers' sales. After all, bread has historically served as a primary food source for people groups across the world.
In bakeries, bread was priced in relation to the price of the wheat used to bake it. If a baker was found to have cheated by shorting their loaves, the consequences were quite severe. For example, in Ancient Egypt, if a baker was found to cheat someone... let's just say they would be down an ear (yes, you read that right). Other punishments included dismemberment and heavy fines. This meant that bakers in places like Medieval England were required to bake meticulously, and to an exacting standard. More often than not, this meant that the bakers would produce more than necessary for their customers.
The practice of including an extra loaf for every dozen eventually made its way up to the Worshipful Company of Bakers guild code in London. Started in the 12th century, this guild played an influential role in creating the rules and standards for bread-baking.
Learn more about the history of bread here.