A fungal nail infection occurs from the overgrowth of fungi in, under, or on the nail.  Fungi thrive in warm, moist environments, so this type of environment can cause them to naturally overpopulate.