A comfit can be any kind of little something that is coated in hard candy or sugar to preserve it. In The Olden Days that might include fruits and nuts as well as seeds and spices. For modern people, you may have encountered comfits in an Indian or similar restaurant: those little bowls of colourful candy-coated fennel seeds are comfits. If you are very lucky, you might even encounter a mixed spice bowl of comfits, with coriander, caraway, cumin or other spices mixed in with the fennel.
Comfits have been made and eaten for hundreds of years across Europe and Asia. They are the ancestors of our modern 100s and 1000s (which are of course just comfits with the spice left out!).
Fennel comfits, as served in Indian restaurants, are popular as an after-dinner palate cleanser. Fennel seeds are considered to aid digestion and reduce gas.
In The Olden Days (which here means during medieval times), comfits were made by hanging a wide, round-based pan, like a wok, over the fire so that one side is hot and the other a little cooler. Sugar syrup and spices were stirred around between the hotter and cooler sides until the comfits were well coated.
Modern recipes suggest simply stirring the seeds around in a pan of sugar syrup, but Heston Blumenthal in one of his historical feasts came up with a really excellent contraption involving a cordless drill (with duck tape holding the trigger on a very slow speed), a big old Milo tin, and a hairdryer. This method stirs the seeds and sugar between the hot side (next to the hairdryer) and the cooler side (away from the hairdryer), allowing the sugar to build up slowly in repeated thin coats, for a more authentic comfit.
I would like to try this method myself, but my hairdryer has long since had the heating element removed so that it can serve as a bellows for the forge in the back shed. Ah well. Luckily, sugar coated fennel seeds are cheap and readily available in Indian or Middle Eastern grocers, and online.