Allicin is a compound formed in freshly crushed garlic, but it oxidizes quickly. PubMed, a medical resource maintained by the United States government, lists studies showing antimicrobal and antifungal properties of garlic and suggest its use as an alternative to antibiotics.
Onions contain a "prebiotic" fiber that feeds "good bacteria" in the intestines.