What causes cat head pressing (headache)?
I have answered the question within the question! Bad feline headaches cause head pressing because it alleviates the pain. So what causes feline headaches? Here are some examples.

Feline head pressing. It is not clear this cat has a headache but this is what feline head pressing looks like. Picture in public domain.
The gastro-intestinal parasite trichinosis causes symptoms of muscle pain, headaches and joint pain. This parasite is acquired by ingesting undercooked pork that contains the encysted larvae of Trichina spiralis. Fifteen percent of people living in the US have at some time acquired this disease.
Sinusitis in cats can cause headaches amongst other symptoms.
Cats with impaired liver function can have a range of symptoms including head pressing which is a sign, as mentioned, of having a bad headache. The cat actually puts his forehead against a wall to try and alleviate the pain.
Portosystemic shunts, are an inherited anatomical defect present at birth. Specifically an abnormal portal vein bypasses the liver and takes blood directly to the heart. Food nutrients and waste products are not processed by the liver. Ammonia products build up inside the cat’s system. The illness’s symptoms include head pressing, seizures and circling and also include weight loss, vomiting, diarrhoea and excessive drooling.
Source: Myself nowadays, but details from Cat Owners Home Veterinary Handbook on various pages.
P.S. Don’t laugh at a cat pressing his head against a wall and make a joke about it on the internet — please.
SOME PAGES ON PARASITES:

Do ticks cause pain in cats?
Read More

8 possible causes of lumps on a cat’s neck, chin or belly
Read More

Do cat fleas jump, climb or crawl?
Read More

Do cats eat bed bugs?
Read More

Killing cat fleas by drowning and using soap
Read More

Do cat fleas live on dogs?
Read More

How do I know if my cat has tapeworms?
Read More

Does cat vomit contain toxoplasmosis?
Read More