Myocarditis is inflammation of the heart muscle can be caused by a variety of infections and conditions and the most common cause is infection of the heart muscle by a virus. The virus invades the heart muscle to cause local inflammation. After the initial infection subsides, the body's immune system continues to inflict inflammatory damage to the heart muscle. This immune response actually prolongs the myocarditis.
Apparently your friend had mild myocarditis and possibly no noticeable symptoms. The most frequent symptom of myocarditis is pain in the chest. When myocarditis is more serious, it leads to weakening of the heart muscle. Myocarditis can then cause heart failure (with symptoms of shortness of breath, fatigue, fluid accumulation in the lungs, etc.) as well as heart rhythm irregularities from inflammation and/or scarring of the electrical system of the heart.
Your friend may have had viral myocarditis and individuals who have/had myocarditis are at some risk for sudden unexpected, potentially fatal, heart rhythm abnormalities. These can often be prevented with implantable defibrillators if the heart muscle damage is severe.
Viruses can go to the heart or brain. If the person is run down or if the virus is antibiotic resistent this can happen. It is very scary. My friend's mother was on an antibiotic for strep throat. She was by the fireplace when her ears started hurting within minutes she passed away at home and shocked everyone around her. She was only in her forties. So sorry about your friend. It is quite a shock to lose someone so suddenly and without warning.