What causes the uncontrollable shaking and shivering after general anesthesia?

Cold, usually. Often during anesthesia, your body temperature drops. When you are awakened, your body tries to warm it up any way it can, and shivering is one of those ways. Another cause can be different parts of the nervous system waking up at different times; if the parts that control shivering (and there are several) wake up first then you shiver more and harder. Men have this issue more than women.
Just happens! Shivering after general anesthesia sometimes happens even if a patient's temperature is normal, usually associated with the anesthesia gases such as Desflurane and sevoflurane. A small dose of Demerol (meperidine hydrochloride) will usually calm down the shivering. We see less of it these days now that we have warming blankets and fluid warmers in wide use in the operating rooms.
Cold and reaction. It is very common for patient to shiver in the immediate post-operative period, that is to say the first day after surgery. This is due to the fact that patients can get cold during surgery. It is not normal for this to continue for more than 24 hours. It can be treated with some medications as well as warming the patient up.