Mechanisms of slip nucleation during earthquakes