Cancer is a mutated cell. When the immune system is unable to destroy all of the multiplying mutated cells a cancer occurs.
Given the complexity of replicating a cell from an exact copy of the DNA to the proper distribution and organization of the chromosomes during mitosis it is inevitable that many cells are damaged in the process.
These damaged cells are cancer cells. However the body's immune system manages to identify and destroy most of the these damaged cells. A cancer occurs when the body's immune system either fails to identity the damaged cell, or can not destroy the cells as quickly as the cells multiply.