Without getting to technical, your muscles contract on a cellular level in order for the muscle to work.
In order for this muscles to contract, k+ and ca+ are required to cross the cellular membranes. To much, or to little potassium
will upset this balance. Hope this helps.