All or nothing phenomena
The fundamental principle behind this is a "sensor" or the excitation-contraction coupling, regardless where you are. 
Let's consider the striated muscle and the cardiac muscle. 

The function of excitation-contraction coupling in skeletal muscle is as voltage sensor to tell the SR, "We have got an action potential; release Ca2+ for contraction".
This is a contrast to a heart muscle which works like a Ca2+ channel (i.e. Ca2+ is flowing in cardiac muscle continuously). 
Similarly, xcitation-contraction coupling in cardiac muscle translates the action potential into the production of tension. 
There are individual steps in this process of cardiac muscle:



The cardiac action potential is initiated in the myocardial cell membrane, and the depolarization spreads to the interior of the cell via the T tubules. 
Recall that a unique feature of the cardiac action potential is its plateau (phase 2), which results from an increase in Ca and an inward Ca2+ current in which Ca2+ flows through L-type Ca2+ channels (dihydropyridine receptors) from extracellular fluid (ECF) to intracellular fluid (ICF).


Entry of Ca2+ into the myocardial cell produces an increase in intracellular Ca2+ concentration. 
This increase in intracellular Ca2+ concentration is not sufficient alone to initiate contraction, but it triggers the release of more Ca2+ from stores in the sarcoplasmic reticulum through Ca2+ release channels (ryanodine receptors). 
This process is called Ca2+- induced Ca2+ release, and the Ca2+ that enters during the plateau of the action potential is called the trigger Ca2+. 
Two factors determine how much Ca2+ is released from the sarcoplasmic reticulum in this step: the amount of Ca2+ previously stored and the size of the inward Ca2+ current during the plateau of the action potential.


and 4. Ca2+ release from the sarcoplasmic reticulum causes the intracellular Ca2+ concentration to increase even further. 
Ca2+ now binds to troponin C, tropomyosin is moved out of the way, and the interaction of actin and myosin can occur. 
Actin and myosin bind, cross-bridges form and then break, the thin and thick filaments move past each other, and tension is produced. 
Cross-bridge cycling continues as long as intracellular Ca2+ concentration is high enough to occupy the Ca2+-binding sites on troponin C.


A critically important concept is that the magnitude of the tension developed by myocardial cells is proportional to the intracellular Ca2+ concentration. 
Therefore, it is reasonable that hormones, neurotransmitters, and drugs that alter the inward Ca2+ current during the action potential plateau or that alter sarcoplasmic reticulum Ca2+ stores would be expected to change the amount of tension produced by myocardial cells.



I like this figure about the topic in summarising stimuli in the smooth muscle:



In heart



In the gastrointestinal tract, we have then again special cells, Cajal cells, that work as "pacemakers" of the GI tract. 
Myenteric Interstitial cells of Cajal [ICC-MY] serve as a pacemaker which creates the bioelectrical slow wave potential that leads to contraction of the smooth muscle.
This activity differs along the length of the system


3 per minute in the stomach 
11-12 per minute in the duodenum 
9-10 per minute in the ileum 
3-4 per minute in the colon


You can see them as to work analogously through the "all-or-none" principle.

Sources


Costanzo, Physiology
Pocock, Physiology
My notes during during years 2011-2014 (in three Physiology courses and research)