It’s hard to imagine how food left out to fester could possibly be good for you. But research has shown how some fermented foods contain bacteria that can help preserve the sanctity of what’s referred to as your “gut biome,” or existing colonies of beneficial bacteria, that live in digestive system.

As a result, many fermented foods and drinks have come to occupy marquee space in your local market. Kombuchas (or fermented teas) in various formations line the shelves, emblazoned with health-promoting promises. Other naturally fermented foods, like yogurt and kefir, kimchi, sauerkraut and tempeh, also now seem to be surging in newfound popularity.

So how do fermented foods help you be healthy?

“Fermentation was a way to prolong the shelf-life of foods back in ancient times. It was an accidental discovery, which augmented the symbiotic relationship with bacteria that we evolved with over hundreds of years,” explains Vincent Pedre, MD., board-certified internist, clinical instructor in medicine at the Mount Sinai School of Medicine, and author of “Happy Gut: The Cleansing Program to Help You Lose Weight, Gain Energy and Eliminate Pain.”

The “good” bacteria some foods acquire during fermentation may potentially have a positive impact on your overall health while keeping “bad” bacteria at bay. “Fermented foods can produce compounds that prevent and destroy the growth of harmful bacteria in the gut, assist in the production of neurotransmitters, acetylcholine (a chemical released by nerve cells to send signals to other cells) and serotonin (a feel-good chemical produced by nerve cells in your gut), aids in the production of stomach acid, boosts your immune system and improves your mood,” says Sandra Allonen, MEd, RD, LDN, outpatient ambulatory dietitian at Beth Israel Deaconess Medical Center in Boston, MA.

Why gut health is so important

“Basically, the gut is the foundation of health upon which every organ in your body is dependent, including your brain,” Pedre explains. “If you can’t absorb nutrients properly, then your body can’t heal. If the gut is so permeable, as in leaky gut syndrome, this has been associated with whole body inflammation, increased risk for metabolic syndrome, glucose intolerance, obesity, dementia and diabetes. Food allergies and sensitivities may be seen on the surface as skin issues, like hives, eczema, and dermatitis, but also internally as migraines, allergies, and asthma. Thus, the gut is strongly connected to every organ system, including the brain, and is a major player in the evolution of systemic, chronic disease,” he explains.

Pedre says fermented foods produce vitamins B12 and K2, which impacts the nervous system to the cardiovascular system to the bones; helping the body to eliminate toxins, fending off harmful bacteria, yeast, and parasites, adding what he calls “friendly flora” to the gut lining — even boosting the immune system.

“Seventy percent of the immune system exists all along the digestive tract,” Pedre explains. “Favorable bacteria has a regulatory effect on the immune system, keeping inflammation down and promoting cells that control the immune response.”

Rising awareness of gut health has driven the sale of probiotics (and related fermented drinks like kombucha) into big business. An article that questions the efficacy of probiotics in Scientific American cites statistics from San Francisco–based business consulting firm Grand View Research, estimating the global probiotics market exceeded $35 billion in 2015 and that it will reach $66 billion by 2024.

Get the better newsletter. This site is protected by recaptcha

But probiotic supplements don’t have plant fibers that contribute to a healthier gut microbiome, says Pedre. So, if you’d rather get your probiotics through fermented foods, where do you start?

Keep an eye out for fermented foods that require refrigeration — Allonen says most fermented foods in supermarket jars or cans have been pasteurized and cooked at high heat, killing any friendly bacteria. She also recommends introducing fermented foods into your diet gradually — they can be problematic if you have yeast overgrowth, like candida. “In this case, eating fermented foods may cause headaches, malaise, fatigue, muscle aches and sometimes even low-grade fevers,” warns Pedre.

Ready to give fermented foods a try? Here are four to add to your diet:

1. Yogurt/Kefir

Pedre recommends homemade kefir as a solid source of good bacteria. “Homemade kefir can achieve probiotic concentrations in the trillions. This can be very beneficial for chronic gut issues of all types, including colitis.” Be super careful though — Allonen warns homemade fermented food that isn’t prepared or handled properly can lead to food poisoning. If you aren’t industrious, seek out plain yogurts and kefirs in the supermarket with live, active cultures and without added sugars or artificial flavors.

2. Sauerkraut

Traced back to ancient times, a tablespoon of sauerkraut, or preserved cabbage, is a great way to take in some good bacteria, says Pedre. However, as this study and Pedre warns, fermentation can increase its histamine content, so those who are histamine sensitive may have a negative reaction to them, like allergies, skin rashes — even hives. “You know if you’re histamine-sensitive if you tend to flush when you drink a glass of wine,” says Pedre.

Kimchi is a traditional Korean dish made from salted fermented vegetables like cabbage and radishes and spices. Nungning20 / Shutterstock / Nungning20

3. Kimchi

This tasty concoction of fermented vegetables and seasonings is the cornerstone of Korean cuisine. It’s also full of fiber, live cultures and probiotics to keep your gut in check. Try it as a condiment with meat and vegetables in a lettuce wrap or taco, in scrambled eggs or in a salad or rice bowl.

4. Tempeh

This traditional Indonesian food made from soaked and cooked soybeans gets moldy during fermentation, infusing it with nutrients. This vegetarian staple can be used in place of meat in salads, soups, stews and more.

But know this

Before stocking up, Allonen warns that savory fermented foods, like pickles, sauerkraut, kimchi, miso and soy sauce, can be loaded with sodium, so read the labels and opt for the low-sodium variety. The American Heart Association recommends keeping your sodium intake to under 1500 mg per day.

4 More Food Trends You Need to Know About

Want more tips like these? NBC News BETTER is obsessed with finding easier, healthier and smarter ways to live. Sign up for our newsletter and follow us on Facebook, Twitter and Instagram.