I guess the AIN0 circuit acts as an ADC trigger to sample the BEMF?
I think the ADC would be too slow for sensing the BEMF so usually use the analog comparator.
AIN0 is also the positive input to the analog comparator. The negative input to the comparator comes through the ADC mux so it can be connected to one of 8 inputs. The center voltage is connected to AIN0 and the program switches the mux to connect BEMF from the undriven wire to the negative comparator input. When the voltage on the undriven wire crosses the center point between the other two wires the comparator switches which triggers the commutation sequence.
To understand how it works, you can read this very long thread. http://www.rcgroups.com/forums/showthread.php?t=200567
Quax is the guru for BLDC controllers and you can learn a lot by looking at the source code on his site. http://home.versanet.de/~b-konze/