Endocarditis is an infection of the inner lining of the heart's chambers and valves (endocardium), usually caused by bacteria or fungi. Endocarditis has the potential to damage or destroy your heart valves and it can be life-threatening if left untreated.