California law requires that every owner of a car and every driver maintain liability insurance at all times. The main purpose of the law is to ensure that money is available to compensate an innocent driver who suffers injuries or damages in an accident with an at-fault driver. However, an innocent driver's failure to maintain his own insurance will also limit the availability of damages that he can collect from an at-fault party.
If you are involved in an accident and you do not have automobile liability insurance, you cannot recover "non-economic" damages from the other party. This is true even if the accident is entirely the other party's fault. "Non-economic" damages include compensation for physical pain or impairment, mental suffering, inconvenience, emotional distress and disfigurement. They are generally referred to simply as "general damages" or "pain and suffering" and the monetary value of such damages often far exceeds the value of other types of damages.
In addition, unlike "economic" damages for which a jury awards damages based upon certain, known amounts (i.e., out-of-pocket costs like medical bills, lost wages, repair bills, etc.), a jury is free to award any amount for non-economic damages. This uncertainty can be a great benefit to injured parties and help a case settle for a reasonable amount before trial.
So while the main purpose of the law is to ensure compensation for the other guy in an accident, having insurance will also ensure all compensation is available to you too!