“Baker’s Dozen”
This phrase refers to the number 13, rather than 12, and there’s a few reasons behind it.
For the most part, this goes back to medieval England, when a baker would add in an extra loaf, in order to avoid being accused of shorting their customers. According to the law, there was a minimum weight that baked goods had to meet. Adding in an extra loaf, accounted for variations in each loaf, to ensure the minimum weight was met.
Later that century, the term also became popular, when bakers would give customers 12 fresh loaves, and throw in one from yesterday as a bonus, just to get rid of it.