In a perfect world, just knowing what causes fungal infections in nails would be enough to avoid getting them, but unfortunately there are some risk factors you have no control over. For example, men are more likely to contract nail fungus than women are[source: Mayo Clinic]. Age is another factor; in fact, the older you get, the greater your chances are of contracting nail fungus, especially for those aged 60 or older [source: PDRhealth]. A family history of nail fungus also plays a part in the likelihood of you getting it.
Fungi are plant-like parasites, and they exist on your body even when you are not suffering an infection. Although nail infections can be caused by yeast, the most common culprits of fungal nail infections are dermatophytes. In fact, 90 percent of fungus-related toenail infections occur when dermatophytes set up residence on your toes [source: WebMD]. So, what's so appealing about your toenails? They're a food source for the fungi. Keratin, the main protein that makes up your skin, hair and nails, is apparently a tasty treat for dermatophytes [sources: PDRhealth and WebMD].
Fungi tend to prosper in dark, moist areas. Covering your feet with non-breathable socks and keeping them stuffed into tight shoes all day creates the perfect environment for fungi to thrive. But swearing off shoes and socks and going barefoot all the time still doesn't mean you won't get nail fungus; in fact, you can pick up nail fungus from walking around barefoot in certain places [source: Mayo Clinic]. If you have even the tiniest cut on your foot, those sneaky little organisms can move right in.
Whether the odds are simply stacked against you or you've forgotten to wear your flip-flops in the locker room shower one too many times, getting a nail fungus does not mean you're doomed to thick, painful nails for the rest of your life. There are several ways to treat fungal infections. Keep reading to learn about them.