There are a number of factor that can cause epilepsy. These include genetic factors where you can inherit genes that increase your chances of getting epilepsy. brain injuries gotten through accidents can also cause epilepsy. In many resource poor settings, infections that can damage the brain such as malaria, toxoplasma, bacterial menengitis and worms have also been shown to cause menengitis.
please not that for most of these factors, they Increase chances of getting epilepsy but have not been clearly demonstrated to be the main causes. Alot of research is still ongoing.
However, epilepsy can be managed and the quality of life of people living with epilepsy greatly improved to almost normal. So if you know anyone with this condition, encourage them to seek medical advice