It's a muscle spasm, where your muscle contracts and seems to knot up. It's painful. Mine are caused because I have nerve damage to my leg and it causes muscle spasms.
Everybody finds different ways to get them to release. Some rub their legs. Some people stretch their legs out, some pull their legs up against their chest. You do whatever it takes to get the calf muscle to relaax...
Also, low potassium will cause leg cramps.....bananas and watermelons are a good souce of potassium.