tension headache is caused by a tension over the forehead or
shoulders or other muscles, causing the head to ache due to.. well,
tension...
migraine is caused by a dilation of the blood vessels in the brain,
causing pressure on the brain... so by ingesting caffeine which
constricts blood vessels, it relieves headache