Cancer can lead to cranial nerve palsies through several mechanisms. Tumors can exert pressure directly on the cranial nerves or involve them through metastasis. Additionally, cancers like nasopharyngeal carcinoma and base of skull tumors are known to invade the cranial nerve foramina, leading to palsies.