Most of the flight is done on autopilot.
Human error is the primary or contributing factor in vast majority of airplane accidents. In most of these cases, it's pilot error. In the rest, it's usually negligent maintenance, incorrect preparations of the plane (for which the captain is primarily responsible) such as bad cargo loading (incorrect centre of gravity calculations), bad fuel loading (too little fuel to reach destination) or other reason. Usually it's a series of human errors, rather than one single bad decision event.
Second most important reason is bad flight conditions, ie. weather related factors. These often contribute to the accidents by exacerbating the pilot errors by reducing recovery margins - if the pilot makes a bad decision, weather can make it harder or impossible to recover from.
Third most important reason is mechanical or electronical failures, of which majority can be attributed to negligent maintenance or ignoring safety protocols. The rest are usually material failures or design flaws, and these are the minority here.
Autopilot as such is little more than glorified cruise control, using automobile analogy, with an integrated navigator (GPS or VOR based). It only does what it's told to do. In all exceptional situations, pilots are required to deal with the situation.
Flight computers in modern airliners can help with controlling the aircraft itself and not exceeding safety limits, but the pilots are the ones who fly the plane and the captain of the plane is the one who makes the decisions on what to do and how to fly the plane.
In many ways, this is the exact same thing that causes the majority of automobile accidents. The reasons for accidents are in same order, even: The most important factor is the driver, then weather and road conditions (and driver's responsibility is to adapt their way of driving to changing conditions), and then mechanical failures which rarely if ever cause fatal accidents.
Ironically, same pattern can be noticed in the present nuclear incidents.
Human operator error has been the primary reason in most nuclear incidents (Chernobyl (exacerbated by design flaws and lack of safety culture) SL-1)
Second most important have been forces of nature. (Fukushima - caused technological failures due to insufficient systems redundancies)
Third most important, technological failures (TMI (exacerbated by human operator errors) and Kyshtym (though arguably Kyshtym disaster was worse than Fukushima and TMI, just less known) )
I can't help but notice this conversation getting de-railed worse every day.