It will be determined via litigation, as it is now. Technological complexity of subject matter has yet to present any serious roadblock, or cause any significant change, in the prosecution of the law.
Similarly, whether neglected maintenance (or third-party modifications/parts) contributed to a collision will be determined in court, just as it is now.
As a side note: given the service opportunities afforded by self-driving vehicles, I would be surprised if operators and insurers didn't subsidize or operate "while you sleep" maintenance service plans. e.g. Once a month or so, while you sleep, your car will drive itself to the shop to get checked out, ensure updates are received, recall services performed, etc.
Manufacturers would add a revenue stream and lower their legal costs/exposure and consumers would have yet-another-hassle of car ownership removed.