A hemispherectomy, also known as a functional hemispherectomy, removes portions of the half of the brain (a "hemisphere") where seizures begin, and disconnects the brain’s two hemispheres. This prevents seizure activity from spreading from one half of the brain to the other.
Watch a medical animation of a functional hemispherectomy.