Why do car insurance rates go up?

After an accident, why do car insurance rates goup? What happened to all the money I've paid in over the years?
Isn't that supposed to cover the cost of the accident?
I'm talking about non-injury accidents.