All life, from humans to cells to chromosomes, has only one purpose - to survive. It turns out that reproduction is an effective way to survive. Also, cooperation is an effective way to survive. The cells in our bodies cooperate for survival. Sometimes cells survive better by no longer cooperating, and reproducing as fast as possible. This winds up killing the host, but the cancer cells don't know that.
And so humans evolve to enforce better cooperation among the cells.
So, no, cancer cells did not evolve to kill you. They do evolve for short term gain, however.
It's an endless struggle.
It's not unlike the struggle between civilized people and criminals.