Epilepsy can occur as a result of cancer, particularly when tumors are located in the brain. Primary brain tumors or metastatic lesions that spread to the brain from other parts of the body can disrupt normal brain function and lead to seizures. Additionally, chemotherapy, radiation therapy, and surgical interventions can also increase the risk of epilepsy in cancer patients.