Headaches in cancer patients can arise due to various reasons. One primary cause is the presence of a brain tumor, which can exert pressure on brain tissues. Other reasons include metastasis of cancer to the brain, side effects from chemotherapy or radiation therapy, and paraneoplastic syndromes. Additionally, medications such as steroids and pain relievers used in cancer treatment can sometimes lead to headaches.