Shivering is a natural reaction of the body to generate warmth. Much like hiccups or sneezing, shivering too is an involuntary action. Involuntary actions are those actions that occur as a reflex response to stimulus and have nothing to do with choice.
When you shiver, your muscles shake in tiny movements to expend energy and generate warmth—the muscles begin to contract and relax rapidly and the blood vessels in your skin start to tighten.
Chills and shivering are only slightly different: shivering is often a response to the cold and it always generates body heat (including shivering when you are scared or stressed or anxious or when you have low blood sugar). Chills are typically accompanied by shivering and can be a sign of illnesses like an infection such as the flu and malaria. Some people have also reported chills with shivering and body pain in COVID-19.
Shivering is also slightly different from tremors; for example, the shaking of hands in Parkinson's disease is not shivering.
While shivering because of cold ambient temperature or cold bathwater does not usually require medical intervention, you should visit a doctor for chills or shivering without an obvious reason and for shivering accompanied by symptoms like fever and body ache.
Your doctor will conduct a physical examination to figure out if the shivering is due to the body getting cold or due to some other health-related problem. He/she may also advise some tests such as a blood test, urine test, mucus test, etc., to determine the exact cause of shivering.
To get relief from the shivering, get your body warmed up, drink plenty of water and other fluids and give sufficient rest to the body. Additionally, consult a doctor. The doctor may prescribe pain relief medicines and antibiotics or bedrest, etc., depending on the diagnosis.