Exactly why someone develops multiple sclerosis (MS) isn't known. It's not caused by anything you have done and it's not clear whether it can be prevented.
What's known so far suggests it's caused by a combination of genetic and environmental factors.
MS is an autoimmune condition, which means your immune system mistakes part of your body for a foreign substance and attacks it.
In the case of MS, it attacks the myelin sheath in the brain and spinal cord.
This is the layer that surrounds your nerves, protecting them and helping electrical signals travel from the brain to the rest of the body.
The attacks cause the myelin sheath to become inflamed in small patches (plaques or lesions), which can be seen on an MRI scan.
These patches of inflammation can disrupt the messages travelling along the nerves.
It can slow them down, jumble them, send them the wrong way, or stop them getting through completely.
This disruption leads to the symptoms and signs of MS.
When the inflammation goes away, it can leave behind scarring of the myelin sheath (sclerosis).
These attacks, particularly if frequent and repeated, can eventually lead to permanent damage to the underlying nerves.
It's not clear what causes the immune system to attack the myelin sheath.
It seems likely that it's partly caused by genes you inherit from your parents and partly by outside factors that may trigger the condition.
Some of the factors that have been suggested as possible causes of MS include:
Further research is needed to understand more about why MS occurs and whether anything can be done to prevent it.