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.

What happens in MS

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.

Why do people get MS?

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:

your genes – MS isn't directly inherited, but people who are related to someone with the condition are more likely to develop it; the chance of a sibling or child of someone with MS also developing it is estimated to be around 2 to 3%

lack of sunlight and vitamin D – MS is more common in countries far from the equator, which could mean that a lack of sunlight and low vitamin D levels may play a role in the condition, although it's not clear whether vitamin D supplements can help prevent MS

smoking – people who smoke are about twice as likely to develop MS compared with those who don't smoke

teenage obesity – people who were obese during their teenage years have an increased risk of developing MS

viral infections – it's been suggested that infections, particularly those caused by the Epstein-Barr virus (responsible for glandular fever), might trigger the immune system, leading to MS in some people

being female – women are 2 to 3 times more likely to develop MS than men; the reason for this is unclear

Further research is needed to understand more about why MS occurs and whether anything can be done to prevent it.