Over all of those trillions of cells and dozens of years, once in a while, a particular cell gets just the right batch of random mutations that make it possible to stay alive while breaking free of its programming and acting as its own organism, independent of the body's plan. It may then proceed to reproduce on its own, potentially disrupting the body's functions and/or consuming all of its resources if it grows quickly enough.
So each individual cancer case is a uniquely evolved life form. There's a few common threads that many tend to share, but no telling how many each particular case may have. Thus, the broad brush approaches tend to be the most successful - surgery, chemotherapy, and radiation. More directed genetic approaches are tougher because of the uniqueness of each case.
Evolutionarily, it's a tricky balance. Too few mechanisms to keep all of your cells under control all the time, and your body dissolves into a mess of cancers too soon, like before you can reproduce. Too many mechanisms wastes resources, can potentially go haywire and damage your body themselves, like autoimmune diseases, or make it too hard for your body to evolve new and useful adaptations to the environment. We already have good enough controls that getting cancer before normal reproduction age is very rare. But now we're living a lot longer, much longer than our bodies are evolutionarily adapted to keep us alive for, so we see a lot more of these kinds of problems.