The exact trigger of MS is still unclear. It occurs when the immune system attacks the spinal cord and brain. A combination of genetic and environmental factors likely trigger the initial attack. One study from 2021 found that vitamin D deficiency, smoking, family history of MS, and migraine are associated with the chance of developing MS.