They price their premiums so that they always make a profit, regardless of the risk.
That's why drivers that have accidents pay more than drivers with no accidents and young drivers (that are statistically more risky) pay more than not-young drivers.
Insurance companies will simply adjust the cost of insurance for self-driving cars to account for risk based on past data. If those cars will turn out to be involved in less accidents, the insurance will cost less. More accidents => cost more.