I am no doctor but I have done a lot of research on the topic, and I also happen to know a few people that actually have epilepsy, albeit mostly mild cases when compared to severe forms of epilepsy.
Anyhow, I have come to believe that people with epilepsy must have some sort of endocannabinoid deficiency or problems, that is alleviated when consuming marijuana. That is why their seizures either stop or are alleviated.
Doctors and scientists have not been allowed to research this due to marijuana's classification as a Schedule 1 Illegal drug.