The heart is the engine of the body. It's always pumping blood. When it stops, you die. Many heart diseases are the result of years of wear and tear but some are congenital, a structural or functional abnormalities there at birth.
As far as birth defects go, congenital heart defects are the most common kind, occurring in at least 1% of all live births.
The general knowledge thus far is that heart defects are not passed on by genetic inheritance, rather, it is a weakness the child is born with that could have something to do with what the mother did while pregnant (like had rubella which is linked to CHD), could be one part of another genetically inherited disorder like cystic fibrosis or could be the bad luck of the draw.
There will always be a certain percentage of live births born with anomalies and as far as medical knowledge currently knows, it's just one of those things some babies are born with but the news is not all bad.