Hi Sam,
There's always a cause, but when they don't know it, or can't find it, they often term it as "idiopathic". Unfortunately, medicine doesn't know everything, or even as much as most of us would think or like that it know. Sorry that's not very reassuring, but it's the way it is.
A muscle cramp can manifest in different ways depending on where it is (what muscle, and what part of the muscle). Some pains (muscle and nerve) are telegraphed, which is why your doc is looking at your back for a cause of pain in your leg.
Diagnosis is a fancy word for an educated guess, and it can take some time. It's important that you build a network of doctors (eventually) in whom you have confidence, trust, and rapport (2-way communication).
There are some sites (Google:
symptom checker) where you can plug-in your symptoms, and get a list of things to discuss with your doctor about checking into or ruling out. If you try some of these sites, don't panic at the results or drive yourself nuts looking up every condition and psyching yourself into believing that's what you've got. It's good to read & learn, but work with your doctor(s) and try to help them help you.
Doc