This is known as tonsilloliths, also known as tonsil stones. Tonsil stones are caused by the accumulation of anaerobic bacteria in the pockets of the tonsils. Anaerobic bacteria cannot survive in oxygenated environments. Try oxygenated mouth rinses, nasal sprays, and toothpastes. One brand to try is Therabreath.
I've asked my sister who is a doctor about this and she said they're called "tonsillar plaques". Yes, they are smelly and they come from the pockets in our tonsillar area. We can cough them out and according to her they're harmless.