Cancer is caused by a number of factors, some of which we can control, and some we cannot. One of the uncontrollable factors is the presence of gene mutations.
Oncogenes affect the way cells use energy and multiply.
Mutations in tumor suppressor genes are another common cause of cancer. As you might expect, a tumor supressor gene is supposed to prevent tumors. But when these genes are damaged, they can allow cancer to develop instead of preventing it. One of these genes, p53, normally prevents cells with abnormal DNA from surviving. When p53 is defective, these cells with abnormal DNA survive and can multiply, increasing the probability of developing cancer.