Nice Question! Lets first introduce ourselves to the topic i.e. [Electrical Muscle Stimulation][1].

>Electrical muscle stimulation (EMS), also known as neuromuscular electrical stimulation (NMES) or electromyostimulation, is the elicitation of muscle contraction using electric impulses...The impulses mimic the action potential coming from the central nervous system, causing the muscles to contract.

Now, lets come to the main point. Its actually not about flow of electrons or ions, but the change in voltage that plays the pivotal role in muscle stimulation. See [this][2]:

>Crystallographic structural studies of a potassium channel have shown that, when a potential difference is introduced over the membrane, the associated electric field induces a conformational change in the potassium channel. The conformational change distorts the shape of the channel proteins sufficiently such that the cavity, or channel, opens to allow influx or efflux to occur across the membrane. This movement of ions down their concentration gradients subsequently generates an electric current sufficient to depolarize the cell membrane.

In short, when you touch a wire, you become a part of the circuit i.e. any 2 points on your hand (or your hand and foot, if you're barefeet) act as part of the circuit i.e. there is potential difference between them, which generates an electric field. This electric field causes the voltage-gated channels in neurons/muscles to open which, in turn, generates an action potential and causes the muscle to contract.

[![voltage-gated channel][3]][3]

_References:_

1. [Electrical Muscle Stimulation - Wikipedia][1]

2. [Voltage-gated Ion Channel - Wikipedia][2]


  [1]: https://en.wikipedia.org/wiki/Electrical_muscle_stimulation
  [2]: https://en.wikipedia.org/wiki/Voltage-gated_ion_channel
  [3]: https://i.sstatic.net/v43aE.png