Cancer can affect the CNS in multiple ways. Primary CNS tumors originate within the brain or spinal cord, while secondary or metastatic tumors spread from other parts of the body to the CNS. The impact of cancer on the CNS can lead to neurological deficits, cognitive impairments, and other severe complications.