Where the pain is a tension headache made worse by intercourse, the underlying causes are the same as for ordinary tension headaches. They are at least partially due to relaxation of the muscle in the walls of the arteries, which allows a higher blood pressure to be transmitted through to tissues which normally aren’t accustomed to such high pressures.
With a headache from a sub-arachnoid haemorrhage, caused by a ruptured berry aneurysm (a balloon-like weakness or bulge in the blood vessel), the escape of blood into the area surrounding the brain, and the pressure it develops locally, are the root causes for the pain.
In the third type, true coital headache, no one is really sure what happens. There is a definite association of true coital headache with migraine, so it’s quite possible that there is a common factor; blood vessels in the brain which are abnormally responsive in migraine may also be reacting too quickly to changes in body chemistry that occur during intercourse. (‘True coital headache’ and ‘exercise headache’ may both be just variants of migraine.)