If you look back into the history of a lot of ingredients, you will find that at one time they were used for something very different than what we use them for today! Because the ingredients in a lot of candies were actually once used for medicinal purposes, it’s not hard to see how medicine easily became candy.
For example, did you know that marshmallows were once used as medicine? The marshmallow plant is a very effective herbal medicine against coughs and sore throats because it has a thick mucilage that easily comforts the respiratory system. The ancient Egyptians used the plant in this way. It wasn’t until much later that the French began to mix the marshmallow root with sugar and egg whites to create something similar to what we know as marshmallows today.
In the Middle Ages, candy was used to soothe soar throats and help digestion. It was often mixed with spices. Even chocolate was once used exclusively as a medicine by ancient South American native tribes as a simulating drink.
Besides that, at old apothecaries pills use to be coated in honey to make them more palatable and easy to swallow. Or they mixed them into syrups and teas. Flavors that we often associate with candy now were once used exclusively for medicine like horehound, peppermint, anise and spearmint.