Epilepsy (recurring seizures) can be treated with surgery in selected cases. This is usually predicated on medications not working and a subsequent detailed investigation with regard to whether there is a cause for seizures and where they are coming from. This involves MRI scans (to look for abnormal areas), extended hospital admissions to record video and EEG (brain waves) to see if seizures start in one location, other tests such as MEG (magnetoencephalography), PET (Positron emission tomography.... radioctive tracer to look at brain activity), SPECT (single photon emission tomography) and other tests. All this requires a specialized team for surgical treatment of epilepsy including specially trained neurologists, neurosurgeons, neuropsychologists, nurses, EEG technicians etc. In young children this should be in a specialized children's hospital.
Seizures starting in a localized abnormal area can be helped by removing that area surgically. "Generalized" seizures that start all over cannot be helped by surgical removal of brain areas but there are options for disconnection of stimulation of either brain areas of the vagus nerve in the neck by implanted pacemakers.
In summary, most seizures are not treated by surgery because medications work. When medications are not working optimally, surgery can be a consideration in some if the extensive work-up leads to reasonable surgical options.... so only a minority for surgery overall.