Epilepsy is the tendency to have unprovoked epileptic seizures. Anything causing structural or functional derangement of brain physiology may lead to seizures, and different conditions may express themselves solely by recurrent seizures and thus be labelled "epilepsy." Worldwide, epilepsy is the most common serious neurological condition. The range of risk factors for the development of epilepsy varies with age and geographic location. Congenital, developmental and genetic conditions are mostly associated with the development of epilepsy in childhood, adolescence and early adulthood. Head trauma, infections of the central nervous system (CNS) and tumours may occur at any age and may lead to the development of epilepsy. Infections of the CNS are a major risk factor for epilepsy. The reported risk of unprovoked seizures in population-based cohorts of survivors of CNS infections from developed countries is between 6.8 and 8.3 %, and is much higher in resource-poor countries. In this review, the various viral, bacterial, fungal and parasitic infectious diseases of the CNS which result in seizures and epilepsy are discussed. The pathogenesis of epilepsy due to brain infections, as well as the role of experimental models to study mechanisms of epileptogenesis induced by infectious agents, is reviewed. The sterile (non-infectious) inflammatory response that occurs following brain insults is also discussed, as well as its overlap with inflammation due to infections, and the potential role in epileptogenesis. Furthermore, autoimmune encephalitis as a cause of seizures is reviewed. Potential strategies to prevent epilepsy resulting from brain infections and non-infectious inflammation are also considered.