Endocarditis is inflammation of the endocardium, the inner lining of the heart. It is caused by bacteria, fungi, or other germs. If these germs invade the bloodstream, they can attach to abnormal areas of the heart.