Genetics can play a crucial role in cancer risk. Some people inherit mutations in certain genes that significantly increase their risk of specific cancers. For example, mutations in the BRCA1 and BRCA2 genes are linked to higher risks of breast and ovarian cancers. Genetic testing can help identify these predispositions.