An infection of the heart's inner lining, usually involving the heart valves. Endocarditis usually occurs when germs from elsewhere in the body travel through the blood and attach to damaged areas of the heart. People with damaged or artificial heart valves or other heart conditions are most at risk.