Action potentials occur because of voltage gated ion channels
If the stimulating potential causes the membrane potential to rise about 15-20 mV an action potential results.
This is due to the opening of voltage gated ion channels
voltage gated channels open briefly then shut