While a lot of mainstream science media have been saying this, the paper that these stories are based on is much less clear. Now as the paper is stuck behind a pay-wall that I don't have acces to myself, I'll have to point you to this excellent article that explains the true findings of the paper. For certain types of cancer, it appears that maybe more of the risk is contributed to by chance mutations rather than environment but in others there is an extremely high environmental risk. For example This paper suggests that smoking contributes about 75% of the risk for lung cancer.Lifestyle can still give you much more of a fighting chance of not only avoiding cancer, but also being able to overcome it if you are one of the unlucky ones. While the statistics aren't entirely clear, it is entirely logical that keeping your body in good condition by eating right, staying active and not smoking will give you the best chance of being able to cope with the effects of both cancer and the treatments (which can often be as if not more gruelling). However what I can explain is how random errors can contribute to cancer (something that the mainstream science media also didn't do very well).
So how does cancer arise and why is it apparently so random? I've previously written a brief explanation of how cancer occurs here but essentially, every time the cells in your body divide (which most do on a fairly regular basis) they have to replicate their DNA. The process of cell division is very complex and it is still not yet known exactly how it works, but it is known that every cell division is not perfect, despite a number of mechanisms that try to cut down on the number of errors. These errors in DNA replication are mutations, most of which will not be of any consequence as approximately 70% of our DNA is "junk" DNA (ie it doesn't code for any proteins). However, if there is a mutation in a sequence of DNA that codes for a protein that regulates how a cell divides, or how it dies, or whether it stays in the same place or is able to freely move around the body that cell is on the way to becoming cancerous.
|Cell Replication is not 100% perfect|
Now this happens far more often than the amount of cases of cancer, as there a number of mechanisms that help to prevent cells from going rogue, but sometimes these cells accumulate enough errors that it actually does become cancerous. Particularly if there is a mutation that then increases the likelihood of further mutations occurring, then these mutations can grow in number rapidly. This helps to explain why most cancers occur later in life, as there will have been more time for mutations to have accumulated (some are more likely to occur in childhood but that's a whole article in itself).
Unfortunately you will need to have a subscription to Science in order to read the full article, but you can read the abstract and editor's summary here and you can read more about cell replication and DNA errors in this great article with some really fascinating images.
If you have any questions or comments please leave them down below or ask me on twitter