That is a good question!
People with congenital heart defects, heart valve replacements, or history of heart infections are recommended to take an antibiotic to protect their heart from possible infections that can occur after dental, gastric and/or respiratory procedures. Some procedures can cause minute amounts of bacteria in the blood. In people who are high risk, these bacteria can seat in parts of the heart and infect the heart. This is called bacterial endocarditis.
The American Heart Association has published guidelines to inform patients and doctors on what patients need premedication and for what kinds of procedures.
This website will give you the link to the most recent American Heart Association recommendations for dental care:
Some orthopedists will recommend antibiotics after hip, knee or other joint replacements. If you have a joint replacement and are concerned ask your physician.
Overall, the guidelines are meant to protect you and your heart!