The cause of breast cancer is probably a combination of factors. These include lifestyle factors, environmental factors, hormone factors, and probably other unknown factors. Your genetic make-up is another factor which is known to be involved.
About 1 in 20 women are likely to carry a faulty gene that gives them a higher risk than the general population of developing breast cancer. This may vary from a moderate increase in risk to a high risk. You inherit half of your genes from your mother and half of your genes from your father. So, if you carry a faulty gene there is a 50:50 chance that you will pass it on to each child that you have. Because of these faulty genes, breast cancer does occur more often than usual in some families. This is sometimes called 'familial breast cancer' or 'hereditary breast cancer'.
However, as breast cancer is common, many of us will have a relative who has been diagnosed with breast cancer. This is not usually due to any of the 'faulty genes' mentioned above, but is more often 'by chance'.
Most women with a family history of breast cancer do not have a greatly increased risk of developing breast cancer compared to the normal risk of the general population.
So it is generally just 'by chance'. The benefit we have these days is the ability to recognise the symptoms early on and hopefully get it treated before it spreads.